Skip to content

Commit

Permalink
Project metadata: Add versioning based on Git tags, using versioningit
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Feb 13, 2023
1 parent 643de58 commit 05b8bd2
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 26 deletions.
15 changes: 0 additions & 15 deletions .bumpversion.cfg

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
- name: Setup project
run: |
# Install package in editable mode.
pip install wheel
pip install versioningit wheel
pip install --editable=.[test,develop]
- name: Check code style
Expand Down
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ in progress
===========

- Modernize Docker configuration, now using Debian bullseye and Python 3.11.
- Improve nightly and on-PR Docker builds.
- Add versioning based on Git tags, using ``versioningit``. This will aid in
telling PR- and nightly releases apart from GA releases when running
``mqttwarn --version``.


2022-11-21 0.31.0
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RUN chown -R mqttwarn:mqttwarn /etc/mqttwarn

# Install mqttwarn
COPY . /src
RUN pip install wheel
RUN pip install versioningit wheel
RUN pip install /src

# Make process run as "mqttwarn" user
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.full
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ RUN chown -R mqttwarn:mqttwarn /etc/mqttwarn

# Install mqttwarn
COPY . /src
RUN pip install wheel
RUN pip install versioningit wheel
RUN pip install /src[all]

# Make process run as "mqttwarn" user
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ $(eval venvpath := .venv)
$(eval pip := $(venvpath)/bin/pip)
$(eval python := $(venvpath)/bin/python)
$(eval pytest := $(venvpath)/bin/pytest)
$(eval bumpversion := $(venvpath)/bin/bumpversion)
$(eval minibump := $(venvpath)/bin/minibump)
$(eval twine := $(venvpath)/bin/twine)
$(eval sphinx := $(venvpath)/bin/sphinx-build)
$(eval isort := $(venvpath)/bin/isort)
Expand All @@ -21,6 +21,7 @@ $(eval poe := $(venvpath)/bin/poe)
# Setup Python virtualenv
setup-virtualenv:
@test -e $(python) || python3 -m venv $(venvpath)
$(pip) install versioningit


# -------
Expand Down Expand Up @@ -71,7 +72,7 @@ docs-html: install-doctools
# Utility targets
# ===============
bumpversion: install-releasetools
@$(bumpversion) $(bump)
@$(minibump) bump --relax $(bump)

push:
git push && git push --tags
Expand Down
11 changes: 8 additions & 3 deletions mqttwarn/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# -*- coding: utf-8 -*-
# (c) 2014-2018 The mqttwarn developers

__version__ = "0.31.0"
# (c) 2014-2023 The mqttwarn developers

__author__ = "Jan-Piet Mens <jpmens()gmail.com>, Ben Jones <ben.jones12()gmail.com>"
__copyright__ = "Copyright 2014-2022 Jan-Piet Mens"
__license__ = "Eclipse Public License - v 2.0 (http://www.eclipse.org/legal/epl-2.0/)"

try:
from importlib.metadata import version
except ImportError:
from importlib_metadata import version

__version__ = version("mqttwarn")
15 changes: 15 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# ==================
# Build system setup
# ==================

[build-system]
requires = [
"setuptools>=42", # At least v42 of setuptools required!
"versioningit",
]
build-backend = "setuptools.build_meta"


[tool.versioningit]


# =========================
# Linter and code formatter
# =========================
Expand Down
2 changes: 1 addition & 1 deletion requirements-release.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
bump2version
minibump<1; python_version>='3.10'
twine
keyring
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# -*- coding: utf-8 -*-
# (c) 2014-2022 The mqttwarn developers
# (c) 2014-2023 The mqttwarn developers
import os
import platform

from setuptools import find_packages, setup
from versioningit import get_cmdclasses

here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, "README.rst")).read()
Expand All @@ -16,6 +17,7 @@
"docopt<1",
"requests<3",
"future>=0.18.0,<1",
"importlib-metadata; python_version<'3.8'",
]

extras = {
Expand Down Expand Up @@ -170,8 +172,8 @@


setup(
cmdclass=get_cmdclasses(),
name="mqttwarn",
version="0.31.0",
description="mqttwarn - subscribe to MQTT topics and notify pluggable services",
long_description=README,
license="EPL 2.0",
Expand Down

0 comments on commit 05b8bd2

Please sign in to comment.