Skip to content

Commit

Permalink
v24.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
GitRon committed Jun 14, 2024
1 parent 1196bb9 commit 87cb545
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 16 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.5
rev: v0.4.8
hooks:
# Run the Ruff linter.
- id: ruff
Expand All @@ -12,14 +12,14 @@ repos:
- id: ruff-format

- repo: https://github.com/asottile/pyupgrade
rev: v3.15.2
rev: v3.16.0
hooks:
- id: pyupgrade
args: [ --py38-plus ]
stages: [ push ]

- repo: https://github.com/adamchainz/django-upgrade
rev: 1.16.0
rev: 1.18.0
hooks:
- id: django-upgrade
args: [--target-version, "4.2"]
Expand Down
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

**24.6.1 (2024-06-14)**
* Added `module_name` variable to Package metadata
* Added opt-out for internationalisation content in Readme-file
* Removed fixed links to Ambient as a maintainer in templates
* Updated linters
* Removed Django 3.2 from test matrix

**24.4.4 (2024-04-11)**
* Updated ruff configuration

Expand Down
2 changes: 1 addition & 1 deletion ambient_package_update/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Ambient package update tool for clean and swift maintenance"""

__version__ = "24.4.4"
__version__ = "24.6.1"
8 changes: 8 additions & 0 deletions ambient_package_update/metadata/maintainer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import dataclasses


@dataclasses.dataclass
class PackageMaintainer:
name: str
url: str
email: str
3 changes: 3 additions & 0 deletions ambient_package_update/metadata/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@

from ambient_package_update.metadata.author import PackageAuthor
from ambient_package_update.metadata.constants import LICENSE_MIT
from ambient_package_update.metadata.maintainer import PackageMaintainer
from ambient_package_update.metadata.readme import ReadmeContent
from ambient_package_update.metadata.ruff_ignored_inspection import RuffIgnoredInspection


@dataclasses.dataclass
class PackageMetadata:
package_name: str
module_name: str
company: str
authors: list[PackageAuthor]
maintainer: PackageMaintainer
development_status: str
readme_content: ReadmeContent
has_migrations: bool
Expand Down
1 change: 1 addition & 0 deletions ambient_package_update/metadata/readme.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ class ReadmeContent:
content: Optional[str] = None
custom_installation: Optional[str] = None
additional_installation: Optional[str] = None
uses_internationalisation: bool = True
6 changes: 0 additions & 6 deletions ambient_package_update/templates/.github/workflows/ci.yml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@ jobs:
django-version: [{% for django_version in supported_django_versions %}'{{ django_version|replace(".", "") }}', {% endfor %}]

exclude:
- python-version: '3.12'
django-version: 32
- python-version: '3.11'
django-version: 32
- python-version: '3.10'
django-version: 32
- python-version: '3.8'
django-version: 50
- python-version: '3.9'
Expand Down
6 changes: 3 additions & 3 deletions ambient_package_update/templates/.pre-commit-config.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.5
rev: v0.4.8
hooks:
# Run the Ruff linter.
- id: ruff
Expand All @@ -12,14 +12,14 @@ repos:
- id: ruff-format

- repo: https://github.com/asottile/pyupgrade
rev: v3.15.2
rev: v3.16.0
hooks:
- id: pyupgrade
args: [ --py{{ supported_python_versions.0|replace(".", "") }}-plus ]
stages: [ push ]

- repo: https://github.com/adamchainz/django-upgrade
rev: 1.16.0
rev: 1.18.0
hooks:
- id: django-upgrade
args: [--target-version, "{{ supported_django_versions.0 }}"]
Expand Down
4 changes: 3 additions & 1 deletion ambient_package_update/templates/README.md.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* [PyPI](https://pypi.org/project/{{ package_name|replace("_", "-") }}/)
* [GitHub](https://github.com/ambient-innovation/{{ github_package_name|replace("_", "-") }})
* [Full documentation](https://{{ package_name|replace("_", "-") }}.readthedocs.io/en/latest/index.html)
* Creator & Maintainer: [Ambient Digital](https://ambient.digital)
* Creator & Maintainer: [{{ maintainer.name }}]({{ maintainer.url }})

{{ readme_content.content }}

Expand Down Expand Up @@ -105,6 +105,7 @@ Example: run all hooks of pre-push stage
- To build the documentation run: `sphinx-build docs/ docs/_build/html/`.
- Open `docs/_build/html/index.html` to see the documentation.

{% if readme_content.uses_internationalisation %}
### Translation files

If you have added custom text, make sure to wrap it in `_()` where `_` is
Expand All @@ -121,6 +122,7 @@ How to compile translation files:
* Navigate to `{{ package_name|replace("_", "-") }}`
* `python manage.py compilemessages`
* Have a look at the new/changed files within `{{ package_name }}/locale`
{% endif %}

### Publish to ReadTheDocs.io

Expand Down
2 changes: 1 addition & 1 deletion ambient_package_update/templates/docs/conf.py.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ from {{ package_name }} import __version__ # noqa: E402

project = "{{ package_name|replace("_", "-") }}"
copyright = "{{ current_year }}, Ambient Innovation: GmbH" # noqa: A001
author = "Ambient Innovation: GmbH <hello@ambient.digital>"
author = "{{ maintainer.name }} <{{ maintainer.email }}>"
version = __version__
release = __version__

Expand Down
2 changes: 1 addition & 1 deletion ambient_package_update/templates/pyproject.toml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ name = "{{ package_name }}"
[project.urls]
'Homepage' = 'https://github.com/ambient-innovation/{{ github_package_name|replace("_", "-") }}/'
'Documentation' = 'https://{{ package_name|replace("_", "-") }}.readthedocs.io/en/latest/index.html'
'Maintained by' = 'https://ambient.digital/'
'Maintained by' = '{{ maintainer.url }}'
'Bugtracker' = 'https://github.com/ambient-innovation/{{ github_package_name|replace("_", "-") }}/issues'
'Changelog' = 'https://{{ package_name|replace("_", "-") }}.readthedocs.io/en/latest/features/changelog.html'

Expand Down

0 comments on commit 87cb545

Please sign in to comment.