Our great sponsors
-
commitizen
Create committing rules for projects :rocket: auto bump versions :arrow_up: and auto changelog generation :open_file_folder:
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
--- 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.