Package: ambient-package-update
Ambient Package UpdateThis repository will help keep all Python packages following a certain basic structure tidy and up-to-date. It's being
maintained byAmbient 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 releasedA Python or Django version was deprecatedYou want to update the Sphinx documentation builderYou want to update the linter versionsYou want to add the third-party dependenciesVersioningThis project follows the CalVer versioning pattern:YY.MM.[RELEASE]How to update a packageThese steps will tell you how to update a package which was created by using this updater.Navigate to the main directory ofyourpackageActivate your virtualenvRunpython -m ambient_package_update.cli render-templatesValidate the changes and increment the version accordinglyRelease a new version of your target packageHow to create a new packageJust follow these steps if you want to create a new package and maintain it using this updater.Create a new repo at GitHubCheck 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.fromambient_package_update.metadata.authorimportPackageAuthorfromambient_package_update.metadata.constantsimportDEV_DEPENDENCIESfromambient_package_update.metadata.packageimportPackageMetadatafromambient_package_update.metadata.readmeimportReadmeContentfromambient_package_update.metadata.ruff_ignored_inspectionimportRuffIgnoredInspectionMETADATA=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},ruff_ignore_list=[RuffIgnoredInspection(key='XYZ',comment="Reason why we need this exception"),],)Install theambient_package_updatepackage# ideally in a virtual environment
pip install ambient-package-updateAdddocs/index.rstand 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 basisFinally, follow the steps of the section above (How to update a package).ContributionDependency updatesThe dependencies of this package are being maintained withpip-tools.pip install -U pip-toolsTo add/update/remove a package, please do so in the mainpyproject.toml. Afterward, call the following command to
reflect your changes in therequirements.txt.pip-compile --extra dev -o requirements.txt pyproject.toml --resolver=backtrackingTo install the packages, run:pip-syncPublish to PyPiUpdate documentation about new/changed functionalityUpdate theChangelogIncrement version in main__init__.pyIncrement version of this package in dependencies inambient_package_update/metadata/constants.pyCreate pull request / merge to masterThis project uses the flit package to publish to PyPI. Thus publishing should be as easy as running:flit publishTo publish to TestPyPI use the following ensure that you have set up your .pypirc as
shownhereand use the following command:flit publish --repository testpypiChangelogCan be found atGitHub.