diff --git a/CHANGES.md b/CHANGES.md index 1c42742..c34dbae 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,13 @@ # Changelog +**23.10.3 (2023-10-26)** +* Added custom_installation metadata (renamed from `installation`) +* Added additional_information metadata +* Added flag for rendering migration related things in metadata +* Added migration validator to GitHub actions +* Removed HTML coverage report in GitHub actions +* Updated readthedocs.yml template + **23.10.2 (2023-10-20)** * Add coverage check to CI pipeline * Enforced 100% coverage and added badge diff --git a/ambient_package_update/__init__.py b/ambient_package_update/__init__.py index 25b6652..350ae86 100644 --- a/ambient_package_update/__init__.py +++ b/ambient_package_update/__init__.py @@ -1,3 +1,3 @@ """Ambient package update tool for clean and swift maintenance""" -__version__ = '23.10.2' +__version__ = '23.10.3' diff --git a/ambient_package_update/metadata/package.py b/ambient_package_update/metadata/package.py index b1367a1..9cfae3a 100644 --- a/ambient_package_update/metadata/package.py +++ b/ambient_package_update/metadata/package.py @@ -14,6 +14,7 @@ class PackageMetadata: authors: list[PackageAuthor] development_status: str readme_content: ReadmeContent + has_migrations: bool dependencies: list[str] supported_django_versions: list[str] supported_python_versions: list[str] diff --git a/ambient_package_update/metadata/readme.py b/ambient_package_update/metadata/readme.py index 8845c32..34fbfa5 100644 --- a/ambient_package_update/metadata/readme.py +++ b/ambient_package_update/metadata/readme.py @@ -6,4 +6,5 @@ class ReadmeContent: tagline: str content: Optional[str] = None - installation: Optional[str] = None + custom_installation: Optional[str] = None + additional_installation: Optional[str] = None diff --git a/ambient_package_update/templates/.github/workflows/ci.yml.tpl b/ambient_package_update/templates/.github/workflows/ci.yml.tpl index 56f4737..177cc5b 100644 --- a/ambient_package_update/templates/.github/workflows/ci.yml.tpl +++ b/ambient_package_update/templates/.github/workflows/ci.yml.tpl @@ -48,7 +48,9 @@ jobs: - name: Run Tests env: TOXENV: django${% raw %}{{ matrix.django-version }}{% endraw %} - run: tox + run: tox{% if has_migrations %} + - name: Validate migration integrity + run: python manage.py makemigrations --check --dry-run{% endif %} - name: Upload coverage data uses: actions/upload-artifact@v3 with: @@ -76,13 +78,5 @@ jobs: - name: Combine coverage and fail if it's <100% run: | - # python -m coverage combine python -m coverage html --skip-covered --skip-empty python -m coverage report --fail-under=100 - - - name: Upload HTML report - if: ${% raw %}{{ failure() }}{% endraw %} - uses: actions/upload-artifact@v3 - with: - name: html-report - path: htmlcov diff --git a/ambient_package_update/templates/.readthedocs.yaml.tpl b/ambient_package_update/templates/.readthedocs.yaml.tpl new file mode 100644 index 0000000..d01b520 --- /dev/null +++ b/ambient_package_update/templates/.readthedocs.yaml.tpl @@ -0,0 +1,28 @@ +# .readthedocs.yaml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Set the OS, Python version and other tools you might need +build: + os: ubuntu-22.04 + tools: + python: "3.12" + +# Build documentation in the "docs/" directory with Sphinx +sphinx: + configuration: docs/conf.py + +# Optionally build your docs in additional formats such as PDF and ePub +# formats: +# - pdf +# - epub + +# Optional but recommended, declare the Python requirements required +# to build your documentation +# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html +# python: +# install: +# - requirements: docs/requirements.txt diff --git a/ambient_package_update/templates/.readthedocs.yml.tpl b/ambient_package_update/templates/.readthedocs.yml.tpl deleted file mode 100644 index 1ea0bf8..0000000 --- a/ambient_package_update/templates/.readthedocs.yml.tpl +++ /dev/null @@ -1,24 +0,0 @@ -# .readthedocs.yml -# Read the Docs configuration file -# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details - -# Required -version: 2 - -# Set the version of Python and other tools you might need -build: - os: ubuntu-22.04 - tools: - python: "3.11" - -# Build documentation in the docs/ directory with Sphinx -sphinx: - configuration: docs/conf.py - -# Optionally declare the Python requirements required to build your docs -python: - install: - - method: pip - path: . - extra_requirements: - - dev diff --git a/ambient_package_update/templates/README.md.tpl b/ambient_package_update/templates/README.md.tpl index efa32a8..905f0dc 100644 --- a/ambient_package_update/templates/README.md.tpl +++ b/ambient_package_update/templates/README.md.tpl @@ -16,8 +16,8 @@ ## Installation -{% if readme_content.installation %} - {{ readme_content.installation }} +{% if readme_content.custom_installation %} +{{ readme_content.custom_installation }} {% else %} - Install the package via pip: @@ -35,6 +35,14 @@ '{{ package_name }}', ) ```` + +{% if has_migrations %} +- Apply migrations by running: + + `python ./manage.py migrate` +{% endif %} + +{% if readme_content.additional_installation %}{{ readme_content.additional_installation }}{% endif %} {% endif %} ## Contribute diff --git a/pyproject.toml b/pyproject.toml index b991237..b7a8028 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,9 +25,14 @@ classifiers = [ ] dynamic = ["version", "description"] license = {"file" = "LICENSE.md"} -dependencies = [ +dependencies = [] + +[project.optional-dependencies] +dev = [ + # Rendering 'typer~=0.9', 'Jinja2~=3.1', + # Deploy 'flit~=3.9', 'keyring~=24.2', # Linting