From b290eb1ef297a889fb71aed88d558bddd2655daf Mon Sep 17 00:00:00 2001 From: Jelmer Draaijer Date: Sun, 6 Oct 2024 12:16:31 +0200 Subject: [PATCH] Use uv run for sphinx-build --- docs/Makefile | 2 +- tests/test_cookiecutter_generation.py | 2 +- {{cookiecutter.project_slug}}/docs/Makefile | 2 +- {{cookiecutter.project_slug}}/docs/make.bat | 2 +- {{cookiecutter.project_slug}}/pyproject.toml | 230 +++++++++---------- 5 files changed, 119 insertions(+), 119 deletions(-) diff --git a/docs/Makefile b/docs/Makefile index 722f50c7c..fec1fc965 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -3,7 +3,7 @@ # You can set these variables from the command line. SPHINXOPTS = -SPHINXBUILD = sphinx-build +SPHINXBUILD = uv run sphinx-build SOURCEDIR = . BUILDDIR = _build diff --git a/tests/test_cookiecutter_generation.py b/tests/test_cookiecutter_generation.py index a598c23f0..560085013 100755 --- a/tests/test_cookiecutter_generation.py +++ b/tests/test_cookiecutter_generation.py @@ -315,7 +315,7 @@ def test_gitlab_invokes_precommit_and_pytest(cookies, context, use_docker, expec try: gitlab_config = yaml.safe_load(gitlab_yml) assert gitlab_config["precommit"]["script"] == [ - "pre-commit run --show-diff-on-failure --color=always --all-files" + "uv run pre-commit run --show-diff-on-failure --color=always --all-files" ] assert gitlab_config["pytest"]["script"] == [expected_test_script] except yaml.YAMLError as e: diff --git a/{{cookiecutter.project_slug}}/docs/Makefile b/{{cookiecutter.project_slug}}/docs/Makefile index 9e0e4d6c0..bd21c083e 100644 --- a/{{cookiecutter.project_slug}}/docs/Makefile +++ b/{{cookiecutter.project_slug}}/docs/Makefile @@ -4,7 +4,7 @@ # You can set these variables from the command line, and also # from the environment for the first two. SPHINXOPTS ?= -SPHINXBUILD ?= sphinx-build +SPHINXBUILD ?= uv run sphinx-build SOURCEDIR = . BUILDDIR = ./_build {%- if cookiecutter.use_docker == 'y' %} diff --git a/{{cookiecutter.project_slug}}/docs/make.bat b/{{cookiecutter.project_slug}}/docs/make.bat index fbf6eb45f..0fa28a869 100644 --- a/{{cookiecutter.project_slug}}/docs/make.bat +++ b/{{cookiecutter.project_slug}}/docs/make.bat @@ -6,7 +6,7 @@ REM Command file for Sphinx documentation if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -c . + set SPHINXBUILD=uv run sphinx-build -c . ) set SOURCEDIR=_source set BUILDDIR=_build diff --git a/{{cookiecutter.project_slug}}/pyproject.toml b/{{cookiecutter.project_slug}}/pyproject.toml index 7f1add1cf..91d190176 100644 --- a/{{cookiecutter.project_slug}}/pyproject.toml +++ b/{{cookiecutter.project_slug}}/pyproject.toml @@ -144,46 +144,46 @@ force-single-line = true [tool.uv] dev-dependencies = [ "watchdog==4.0.2", # https://github.com/gorakhargosh/watchdog -"Werkzeug[watchdog]==3.0.4", # https://github.com/pallets/werkzeug -"ipdb==0.13.13", # https://github.com/gotcha/ipdb + "Werkzeug[watchdog]==3.0.4", # https://github.com/pallets/werkzeug + "ipdb==0.13.13", # https://github.com/gotcha/ipdb {%- if cookiecutter.use_docker == 'y' %} -"psycopg[c]==3.2.3", # https://github.com/psycopg/psycopg + "psycopg[c]==3.2.3", # https://github.com/psycopg/psycopg {%- else %} -"psycopg[binary]==3.2.3", # https://github.com/psycopg/psycopg + "psycopg[binary]==3.2.3", # https://github.com/psycopg/psycopg {%- endif %} {%- if cookiecutter.use_async == 'y' or cookiecutter.use_celery == 'y' %} -"watchfiles==0.24.0", # https://github.com/samuelcolvin/watchfiles + "watchfiles==0.24.0", # https://github.com/samuelcolvin/watchfiles {%- endif %} -# Testing -# ------------------------------------------------------------------------------ -"mypy==1.11.2", # https://github.com/python/mypy -"django-stubs[compatible-mypy]==5.1.0", # https://github.com/typeddjango/django-stubs -"pytest==8.3.3", # https://github.com/pytest-dev/pytest -"pytest-sugar==1.0.0", # https://github.com/Frozenball/pytest-sugar + # Testing + # ------------------------------------------------------------------------------ + "mypy==1.11.2", # https://github.com/python/mypy + "django-stubs[compatible-mypy]==5.1.0", # https://github.com/typeddjango/django-stubs + "pytest==8.3.3", # https://github.com/pytest-dev/pytest + "pytest-sugar==1.0.0", # https://github.com/Frozenball/pytest-sugar {%- if cookiecutter.use_drf == "y" %} -"djangorestframework-stubs==3.15.1", # https://github.com/typeddjango/djangorestframework-stubs + "djangorestframework-stubs==3.15.1", # https://github.com/typeddjango/djangorestframework-stubs {%- endif %} -# Documentation -# ------------------------------------------------------------------------------ -"sphinx==7.4.7", # https://github.com/sphinx-doc/sphinx -"sphinx-autobuild==2024.10.3", # https://github.com/GaretJax/sphinx-autobuild + # Documentation + # ------------------------------------------------------------------------------ + "sphinx==7.4.7", # https://github.com/sphinx-doc/sphinx + "sphinx-autobuild==2024.10.3", # https://github.com/GaretJax/sphinx-autobuild -# Code quality -# ------------------------------------------------------------------------------ -"ruff==0.6.9", # https://github.com/astral-sh/ruff -"coverage==7.6.1", # https://github.com/nedbat/coveragepy -"djlint==1.35.2", # https://github.com/Riverside-Healthcare/djLint -"pre-commit==3.8.0", # https://github.com/pre-commit/pre-commit + # Code quality + # ------------------------------------------------------------------------------ + "ruff==0.6.9", # https://github.com/astral-sh/ruff + "coverage==7.6.1", # https://github.com/nedbat/coveragepy + "djlint==1.35.2", # https://github.com/Riverside-Healthcare/djLint + "pre-commit==3.8.0", # https://github.com/pre-commit/pre-commit -# Django -# ------------------------------------------------------------------------------ -"factory-boy==3.3.1", # https://github.com/FactoryBoy/factory_boy + # Django + # ------------------------------------------------------------------------------ + "factory-boy==3.3.1", # https://github.com/FactoryBoy/factory_boy -"django-debug-toolbar==4.4.6", # https://github.com/jazzband/django-debug-toolbar -"django-extensions==3.2.3", # https://github.com/django-extensions/django-extensions -"django-coverage-plugin==3.1.0", # https://github.com/nedbat/django_coverage_plugin -"pytest-django==4.9.0", # https://github.com/pytest-dev/pytest-django + "django-debug-toolbar==4.4.6", # https://github.com/jazzband/django-debug-toolbar + "django-extensions==3.2.3", # https://github.com/django-extensions/django-extensions + "django-coverage-plugin==3.1.0", # https://github.com/nedbat/django_coverage_plugin + "pytest-django==4.9.0", # https://github.com/pytest-dev/pytest-django ] [project] @@ -199,94 +199,94 @@ authors = [ requires-python = ">=3.12" dependencies = [ "python-slugify==8.0.4", # https://github.com/un33k/python-slugify -"Pillow==10.4.0", # https://github.com/python-pillow/Pillow -{%- if cookiecutter.frontend_pipeline == 'Django Compressor' %} -{%- if cookiecutter.windows == 'y' and cookiecutter.use_docker == 'n' %} -"rcssmin==1.1.2", # --install-option="--without-c-extensions" # https://github.com/ndparker/rcssmin -{%- else %} -"rcssmin==1.1.2", # https://github.com/ndparker/rcssmin -{%- endif %} -{%- endif %} -"argon2-cffi==23.1.0", # https://github.com/hynek/argon2_cffi -{%- if cookiecutter.use_whitenoise == 'y' %} -"whitenoise==6.7.0", # https://github.com/evansd/whitenoise -{%- endif %} -"redis==5.1.1", # https://github.com/redis/redis-py -{%- if cookiecutter.use_docker == "y" or cookiecutter.windows == "n" %} -"hiredis==3.0.0", # https://github.com/redis/hiredis-py -{%- endif %} -{%- if cookiecutter.use_celery == "y" %} -"celery==5.4.0", # pyup: < 6.0 # https://github.com/celery/celery -"django-celery-beat==2.7.0", # https://github.com/celery/django-celery-beat -{%- if cookiecutter.use_docker == 'y' %} -"flower==2.0.1", # https://github.com/mher/flower -{%- endif %} -{%- endif %} -{%- if cookiecutter.use_async == 'y' %} -"uvicorn[standard]==0.31.0", # https://github.com/encode/uvicorn -"uvicorn-worker==0.2.0", # https://github.com/Kludex/uvicorn-worker -{%- endif %} + "Pillow==10.4.0", # https://github.com/python-pillow/Pillow + {%- if cookiecutter.frontend_pipeline == 'Django Compressor' %} + {%- if cookiecutter.windows == 'y' and cookiecutter.use_docker == 'n' %} + "rcssmin==1.1.2", # --install-option="--without-c-extensions" # https://github.com/ndparker/rcssmin + {%- else %} + "rcssmin==1.1.2", # https://github.com/ndparker/rcssmin + {%- endif %} + {%- endif %} + "argon2-cffi==23.1.0", # https://github.com/hynek/argon2_cffi + {%- if cookiecutter.use_whitenoise == 'y' %} + "whitenoise==6.7.0", # https://github.com/evansd/whitenoise + {%- endif %} + "redis==5.1.1", # https://github.com/redis/redis-py + {%- if cookiecutter.use_docker == "y" or cookiecutter.windows == "n" %} + "hiredis==3.0.0", # https://github.com/redis/hiredis-py + {%- endif %} + {%- if cookiecutter.use_celery == "y" %} + "celery==5.4.0", # pyup: < 6.0 # https://github.com/celery/celery + "django-celery-beat==2.7.0", # https://github.com/celery/django-celery-beat + {%- if cookiecutter.use_docker == 'y' %} + "flower==2.0.1", # https://github.com/mher/flower + {%- endif %} + {%- endif %} + {%- if cookiecutter.use_async == 'y' %} + "uvicorn[standard]==0.31.0", # https://github.com/encode/uvicorn + "uvicorn-worker==0.2.0", # https://github.com/Kludex/uvicorn-worker + {%- endif %} # Django # ------------------------------------------------------------------------------ -"django==5.0.9", # pyup: < 5.1 # https://www.djangoproject.com/ -"django-environ==0.11.2", # https://github.com/joke2k/django-environ -"django-model-utils==5.0.0", # https://github.com/jazzband/django-model-utils -"django-allauth[mfa]==65.0.2", # https://github.com/pennersr/django-allauth -"django-crispy-forms==2.3", # https://github.com/django-crispy-forms/django-crispy-forms -"crispy-bootstrap5==2024.10", # https://github.com/django-crispy-forms/crispy-bootstrap5 -{%- if cookiecutter.frontend_pipeline == 'Django Compressor' %} -"django-compressor==4.5.1", # https://github.com/django-compressor/django-compressor -{%- endif %} -"django-redis==5.4.0", # https://github.com/jazzband/django-redis -{%- if cookiecutter.use_drf == 'y' %} -# Django REST Framework -"djangorestframework==3.15.2", # https://github.com/encode/django-rest-framework -"django-cors-headers==4.4.0", # https://github.com/adamchainz/django-cors-headers -# DRF-spectacular for api documentation -"drf-spectacular==0.27.2", # https://github.com/tfranzel/drf-spectacular -{%- endif %} -{%- if cookiecutter.frontend_pipeline == 'Webpack' %} -"django-webpack-loader==3.1.1", # https://github.com/django-webpack/django-webpack-loader -{%- endif %} -"gunicorn==23.0.0", # https://github.com/benoitc/gunicorn -"psycopg[c]==3.2.3", # https://github.com/psycopg/psycopg -{%- if cookiecutter.use_whitenoise == 'n' %} -"Collectfasta==3.2.0", # https://github.com/jasongi/collectfasta -{%- endif %} -{%- if cookiecutter.use_sentry == "y" %} -"sentry-sdk==2.15.0", # https://github.com/getsentry/sentry-python -{%- endif %} -{%- if cookiecutter.use_docker == "n" and cookiecutter.windows == "y" %} -"hiredis==3.0.0", # https://github.com/redis/hiredis-py -{%- endif %} + "django==5.0.9", # pyup: < 5.1 # https://www.djangoproject.com/ + "django-environ==0.11.2", # https://github.com/joke2k/django-environ + "django-model-utils==5.0.0", # https://github.com/jazzband/django-model-utils + "django-allauth[mfa]==65.0.2", # https://github.com/pennersr/django-allauth + "django-crispy-forms==2.3", # https://github.com/django-crispy-forms/django-crispy-forms + "crispy-bootstrap5==2024.10", # https://github.com/django-crispy-forms/crispy-bootstrap5 + {%- if cookiecutter.frontend_pipeline == 'Django Compressor' %} + "django-compressor==4.5.1", # https://github.com/django-compressor/django-compressor + {%- endif %} + "django-redis==5.4.0", # https://github.com/jazzband/django-redis + {%- if cookiecutter.use_drf == 'y' %} + # Django REST Framework + "djangorestframework==3.15.2", # https://github.com/encode/django-rest-framework + "django-cors-headers==4.4.0", # https://github.com/adamchainz/django-cors-headers + # DRF-spectacular for api documentation + "drf-spectacular==0.27.2", # https://github.com/tfranzel/drf-spectacular + {%- endif %} + {%- if cookiecutter.frontend_pipeline == 'Webpack' %} + "django-webpack-loader==3.1.1", # https://github.com/django-webpack/django-webpack-loader + {%- endif %} + "gunicorn==23.0.0", # https://github.com/benoitc/gunicorn + "psycopg[c]==3.2.3", # https://github.com/psycopg/psycopg + {%- if cookiecutter.use_whitenoise == 'n' %} + "Collectfasta==3.2.0", # https://github.com/jasongi/collectfasta + {%- endif %} + {%- if cookiecutter.use_sentry == "y" %} + "sentry-sdk==2.15.0", # https://github.com/getsentry/sentry-python + {%- endif %} + {%- if cookiecutter.use_docker == "n" and cookiecutter.windows == "y" %} + "hiredis==3.0.0", # https://github.com/redis/hiredis-py + {%- endif %} -# Django -# ------------------------------------------------------------------------------ -{%- if cookiecutter.cloud_provider == 'AWS' %} -"django-storages[s3]==1.14.4", # https://github.com/jschneier/django-storages -{%- elif cookiecutter.cloud_provider == 'GCP' %} -"django-storages[google]==1.14.4", # https://github.com/jschneier/django-storages -{%- elif cookiecutter.cloud_provider == 'Azure' %} -"django-storages[azure]==1.14.4", # https://github.com/jschneier/django-storages -{%- endif %} -{%- if cookiecutter.mail_service == 'Mailgun' %} -"django-anymail[mailgun]==12.0", # https://github.com/anymail/django-anymail -{%- elif cookiecutter.mail_service == 'Amazon SES' %} -"django-anymail[amazon-ses]==12.0", # https://github.com/anymail/django-anymail -{%- elif cookiecutter.mail_service == 'Mailjet' %} -"django-anymail[mailjet]==12.0", # https://github.com/anymail/django-anymail -{%- elif cookiecutter.mail_service == 'Mandrill' %} -"django-anymail[mandrill]==12.0", # https://github.com/anymail/django-anymail -{%- elif cookiecutter.mail_service == 'Postmark' %} -"django-anymail[postmark]==12.0", # https://github.com/anymail/django-anymail -{%- elif cookiecutter.mail_service == 'Sendgrid' %} -"django-anymail[sendgrid]==12.0", # https://github.com/anymail/django-anymail -{%- elif cookiecutter.mail_service == 'Brevo' %} -"django-anymail[brevo]==12.0", # https://github.com/anymail/django-anymail -{%- elif cookiecutter.mail_service == 'SparkPost' %} -"django-anymail[sparkpost]==12.0", # https://github.com/anymail/django-anymail -{%- elif cookiecutter.mail_service == 'Other SMTP' %} -"django-anymail==12.0", # https://github.com/anymail/django-anymail -{%- endif %} + # Django + # ------------------------------------------------------------------------------ + {%- if cookiecutter.cloud_provider == 'AWS' %} + "django-storages[s3]==1.14.4", # https://github.com/jschneier/django-storages + {%- elif cookiecutter.cloud_provider == 'GCP' %} + "django-storages[google]==1.14.4", # https://github.com/jschneier/django-storages + {%- elif cookiecutter.cloud_provider == 'Azure' %} + "django-storages[azure]==1.14.4", # https://github.com/jschneier/django-storages + {%- endif %} + {%- if cookiecutter.mail_service == 'Mailgun' %} + "django-anymail[mailgun]==12.0", # https://github.com/anymail/django-anymail + {%- elif cookiecutter.mail_service == 'Amazon SES' %} + "django-anymail[amazon-ses]==12.0", # https://github.com/anymail/django-anymail + {%- elif cookiecutter.mail_service == 'Mailjet' %} + "django-anymail[mailjet]==12.0", # https://github.com/anymail/django-anymail + {%- elif cookiecutter.mail_service == 'Mandrill' %} + "django-anymail[mandrill]==12.0", # https://github.com/anymail/django-anymail + {%- elif cookiecutter.mail_service == 'Postmark' %} + "django-anymail[postmark]==12.0", # https://github.com/anymail/django-anymail + {%- elif cookiecutter.mail_service == 'Sendgrid' %} + "django-anymail[sendgrid]==12.0", # https://github.com/anymail/django-anymail + {%- elif cookiecutter.mail_service == 'Brevo' %} + "django-anymail[brevo]==12.0", # https://github.com/anymail/django-anymail + {%- elif cookiecutter.mail_service == 'SparkPost' %} + "django-anymail[sparkpost]==12.0", # https://github.com/anymail/django-anymail + {%- elif cookiecutter.mail_service == 'Other SMTP' %} + "django-anymail==12.0", # https://github.com/anymail/django-anymail + {%- endif %} ]