Skip to content

Commit

Permalink
Upgrade to uv 0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
epicserve committed Sep 1, 2024
1 parent 195743a commit bca86e9
Show file tree
Hide file tree
Showing 8 changed files with 1,730 additions and 2,043 deletions.
24 changes: 1 addition & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
branches:
- main
- task/upgrade-python-packages
- task/upgrade-python-packages
workflow_dispatch:

jobs:
Expand All @@ -17,27 +16,6 @@ jobs:
- uses: actions/checkout@v4
- name: Use Just for running commands
run: curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin
- name: Setup NPM caching
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-lint-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-lint-
- name: Setup pip caching
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/dev_lock.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Setup uv caching
uses: actions/cache@v4
with:
path: ~/.cache/uv
key: ${{ runner.os }}-uv-${{ hashFiles('**/dev_lock.txt') }}
restore-keys: |
${{ runner.os }}-uv-
- name: Setup Node
uses: actions/setup-node@v4
- name: Setup Python 3.12
Expand All @@ -49,7 +27,7 @@ jobs:
- name: Install Python requirements
run: |
pip install --upgrade uv
uv pip install --system -r config/requirements/dev_lock.txt
uv export | uv pip install --system -r -
- name: Run linting
run: |
PYTHON_CMD_PREFIX="" NODE_CMD_PREFIX="" just lint
Expand Down
8 changes: 6 additions & 2 deletions config/docker/Dockerfile.web
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@ RUN set -ex \
&& $VIRTUAL_ENV/bin/pip install -U setuptools wheel pip uv

# Install Python packages
COPY config/requirements/${ENV_NAME}_lock.txt ./config/requirements/${ENV_NAME}_lock.txt
COPY uv.lock pyproject.toml ./

RUN set -ex \
&& $VIRTUAL_ENV/bin/uv pip install -r config/requirements/${ENV_NAME}_lock.txt \
&& if [ "$ENV_NAME" = "prod" ]; then \
$VIRTUAL_ENV/bin/uv export --no-dev | $VIRTUAL_ENV/bin/uv pip install -r -; \
else \
$VIRTUAL_ENV/bin/uv export | $VIRTUAL_ENV/bin/uv pip install -r -; \
fi \
&& rm -rf /root/.cache/


Expand Down
19 changes: 0 additions & 19 deletions config/requirements/dev.in

This file was deleted.

1,510 changes: 0 additions & 1,510 deletions config/requirements/dev_lock.txt

This file was deleted.

20 changes: 0 additions & 20 deletions config/requirements/prod.in

This file was deleted.

446 changes: 0 additions & 446 deletions config/requirements/prod_lock.txt

This file was deleted.

61 changes: 38 additions & 23 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,27 +1,44 @@
[project]
name = "django-base-site"
description = "A Django project template for creating new Django projects."
version = "0.1.0"
requires-python = ">=3.12"
dependencies = [
"Django~=5.0",
"boto3~=1.34",
"celery~=5.3",
"crispy-bootstrap5~=2024.2",
"django-alive~=2.0",
"django-allauth~=64.0",
"django-crispy-forms~=2.2",
"django-maintenance-mode~=0.19",
"django-storages~=1.8",
"environs[django]~=11.0",
"hiredis~=3.0", # needed for Django's native cache and sessions
"psycopg2-binary~=2.8",
"pytest-cov~=5.0",
"pytest-django~=4.5",
"redis~=5.0", # needed for celery
"uwsgi~=2.0",
]

#[tool.black]
#line-length = 120
#target-version = ['py311']
#skip-string-normalization = false
#exclude = '''
#(
# /(
# | \.git
# | node_modules
# )/
#)
#'''

#[tool.isort]
#line_length = 120
#multi_line_output = 5
#balanced_wrapping = true
#known_django = 'django'
#sections = 'FUTURE,STDLIB,DJANGO,THIRDPARTY,FIRSTPARTY,LOCALFOLDER'
#skip = 'node_modules'

[tool.uv]
dev-dependencies = [
"django-debug-toolbar",
"django-stubs",
"django-test-plus",
# importlib-metadata is a dependency of djlint there is a PR to upgrade it in this issue (https://github.com/Riverside-Healthcare/djLint/pull/504) from 5.2.0 to 6.0.0
"djlint",
"ipdb",
"mkdocs-include-markdown-plugin",
"mkdocs-linkcheck",
"mkdocs-material",
"mkdocstrings[python]",
"model-bakery",
"mypy",
"ruff",
"ruff-lsp",
]

[tool.mypy]
# The mypy configurations: https://mypy.readthedocs.io/en/latest/config_file.html
Expand All @@ -46,11 +63,9 @@ plugins = [
"mypy_django_plugin.main",
]


[tool.django-stubs]
django_settings_module = "config.settings.test_runner"


[tool.pytest.ini_options]
addopts = "--nomigrations --ds config.settings.test_runner --cov-config=config/coverage.ini"

Expand Down
Loading

0 comments on commit bca86e9

Please sign in to comment.