-
commitizen
Create committing rules for projects :rocket: auto bump versions :arrow_up: and auto changelog generation :open_file_folder:
-
Scout Monitoring
Free Django app performance insights with Scout Monitoring. Get Scout setup in minutes, and let us sweat the small stuff. A couple lines in settings.py is all you need to start monitoring your apps. Sign up for our free tier today.
--- repos: - repo: https://github.com/commitizen-tools/commitizen rev: master hooks: - id: commitizen stages: [commit-msg]
The final code can be found here.
import setuptools import toml from os.path import join, dirname, abspath pyproject_path = join(dirname(abspath("__file__")), '../pyproject.toml') file = open(pyproject_path, "r") toml_str = file.read() parsed_toml = toml.loads(toml_str) with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="demo_pip_math", version=parsed_toml['tool']['commitizen']['version'], author="Dennis O'Keeffe", author_email="[email protected]", description="Demo your first Pip package.", long_description=long_description, long_description_content_type="text/markdown", url="https://github.com/okeeffed/your-first-pip-package-in-python", packages=setuptools.find_packages(), classifiers=[ "Programming Language :: Python :: 3", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ], python_requires='>=3.6', keywords='pip-demo math', project_urls={ 'Homepage': 'https://github.com/okeeffed/your-first-pip-package-in-python', }, )
This post will use the pre-commit and commitizen packages to automate our semantic versioning for Python based on our commits.