Skip to main content

Ambient package update tool for clean and swift maintenance

Project description

PyPI release Downloads Linting Coding Style

Ambient Package Update

This repository will help keep all Python packages following a certain basic structure tidy and up-to-date. It's being maintained by Ambient Digital.

This package will render all required configuration and installation files for your target package.

Typical use-cases:

  • A new Python or Django version was released
  • A Python or Django version was deprecated
  • You want to update the Sphinx documentation builder
  • You want to update the linter versions
  • You want to add the third-party dependencies

Versioning

This project follows the CalVer versioning pattern: YY.MM.[RELEASE]

How to update a package

These steps will tell you how to update a package which was created by using this updater.

  • Navigate to the main directory of your package
  • Activate your virtualenv
  • Run python -m ambient_package_update.cli render-templates
  • Validate the changes and increment the version accordingly
  • Release a new version of your target package

How to create a new package

Just follow these steps if you want to create a new package and maintain it using this updater.

  • Create a new repo at GitHub
  • Check out the new repository in the same directory this updater lives in (not inside the updater!)
  • Create a directory ".ambient-package-update" and create a file "metadata.py" inside.
from ambient_package_update.metadata.author import PackageAuthor
from ambient_package_update.metadata.constants import DEV_DEPENDENCIES
from ambient_package_update.metadata.package import PackageMetadata
from ambient_package_update.metadata.readme import ReadmeContent
from ambient_package_update.metadata.ruff_ignored_inspection import (
    RuffIgnoredInspection,
    RuffFilePatternIgnoredInspection,
)

METADATA = PackageMetadata(
    package_name="my_package_name",
    authors=[
        PackageAuthor(
            name="Ambient Digital",
            email="hello@ambient.digital",
        ),
    ],
    development_status="5 - Production/Stable",
    readme_content=ReadmeContent(
        tagline="A fancy tagline for your new package",
        content="""A multiline string containing specific things you want to have in your package readme.
""",
    ),
    dependencies=[
        "my_dependency>=1.0",
    ],
    optional_dependencies={
        "dev": [
            *DEV_DEPENDENCIES,
        ],
        # you might add further extras here
    },
    # Example of a global ruff ignore
    ruff_ignore_list=[
        RuffIgnoredInspection(key="XYZ", comment="Reason why we need this exception"),
    ],
    # Example of a file-based ruff ignore
    ruff_file_based_ignore_list=[
        RuffFilePatternIgnoredInspection(
            pattern="**/tests/missing_init/*.py",
            rules=[
                RuffIgnoredInspection(
                    key="INP001", comment="Missing by design for a test case"
                ),
            ],
        ),
    ],
)
  • Install the ambient_package_update package
    # ideally in a virtual environment
    pip install ambient-package-update
    
  • Add docs/index.rst and link your readme and changelog to have a basic documentation (surely, you can add or write more custom docs if you want!)
  • Enable the readthedocs hook in your GitHub repo to update your documentation on a commit basis
  • Finally, follow the steps of the section above (How to update a package).

Customizing the templates

To customize the templates, you can use the eject-template command. Simply run

python -m ambient_package_update.cli eject-template

from the root of your project and select the template you want to eject. The chosen template will be copied to .ambient-package-update/templates, ready to be customized.

If you want to overwrite template manually, you can find the default templates in the ambient_package_update/templates directory. You can overwrite them by creating a .ambient-package-update/templates directory in your project and create a new file with the same name as the template you want to overwrite.

Changelog

Can be found at GitHub.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ambient_package_update-25.10.18.tar.gz (59.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ambient_package_update-25.10.18-py3-none-any.whl (42.5 kB view details)

Uploaded Python 3

File details

Details for the file ambient_package_update-25.10.18.tar.gz.

File metadata

File hashes

Hashes for ambient_package_update-25.10.18.tar.gz
Algorithm Hash digest
SHA256 63f8b1f0dc747e32b9b5b19674eb0019ecee464ac5a95bca158c22aa80e9d8fe
MD5 cd6ea71a0ffadc67ce2f62b2455690cf
BLAKE2b-256 1ea580990ae8a7e355cd466eec349d1f4899d791dc7ea74c022c2d9663d88d2e

See more details on using hashes here.

File details

Details for the file ambient_package_update-25.10.18-py3-none-any.whl.

File metadata

File hashes

Hashes for ambient_package_update-25.10.18-py3-none-any.whl
Algorithm Hash digest
SHA256 f0d38351a5d12b6cd512a5027f81651a703a9cf7b454035d15db6718e85beba3
MD5 1cabe9ceb52861a240c6886bcb06747d
BLAKE2b-256 4dea2a40ad850d1d931fcab80a1a47d1f9993cfcb39d16066424e163fa594a54

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page