Skip to content

Commit

Permalink
Working merge for file-based semantic versioning using setup.cfg and …
Browse files Browse the repository at this point in the history
…pyproject.toml
  • Loading branch information
Sieboldianus committed May 5, 2023
1 parent e095227 commit 3d1b724
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 13 deletions.
15 changes: 15 additions & 0 deletions docs/package.md
Expand Up @@ -52,3 +52,18 @@ moment, releases are triggered manually after cerain progress is available. Prev
```bash
semantic-release publish --verbosity=DEBUG --noop
```

Without `--noop`, semantic-release will do the [following](https://python-semantic-release.readthedocs.io/en/latest/#semantic-release-publish):

1. Update changelog file.
2. Run [semantic-release version](https://python-semantic-release.readthedocs.io/en/latest/#cmd-version).
3. Push changes to git.
4. Run [build_command](https://python-semantic-release.readthedocs.io/en/latest/configuration.html#config-build-command) and upload the distribution files to Pypi.
5. Run [semantic-release changelog](https://python-semantic-release.readthedocs.io/en/latest/#cmd-changelog) and post to Gitlab/Github.
6. Attach the files created by [build_command](https://python-semantic-release.readthedocs.io/en/latest/configuration.html#config-build-command) to the release.

To trigger a test build:
```bash
pip install -q build
python -m build
```
6 changes: 0 additions & 6 deletions pyproject.toml
@@ -1,9 +1,3 @@
[build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]

[tool.black]
line-length = 88
include = '\.pyi?$'
Expand Down
5 changes: 2 additions & 3 deletions setup.cfg
@@ -1,6 +1,6 @@

[metadata]
name = lbsntransform
version = attr: lbsntransform/version.__version__
author = Alexander Dunkel
author_email = alexander.dunkel@tu-dresden.de
license = GNU GPLv3 or any higher
Expand All @@ -10,8 +10,7 @@ long_description = file: README.md
long_description_content_type = text/markdown

[semantic_release]
version_pattern: README.md:version
version_source: tag
version_variable: src/lbsntransform/version.py:__version__
branch: master
build_command: python -m build

Expand Down
3 changes: 1 addition & 2 deletions src/lbsntransform/__init__.py
Expand Up @@ -2,8 +2,7 @@

"""LBSNtransform package import specifications"""

import importlib.metadata
__version__ = importlib.metadata.version("lbsntransform")
from lbsntransform.version import __version__

from lbsntransform.lbsntransform_ import LBSNTransform
from lbsntransform.config.config import BaseConfig
Expand Down
2 changes: 0 additions & 2 deletions src/lbsntransform/__main__.py
Expand Up @@ -15,8 +15,6 @@

__author__ = "Alexander Dunkel"
__license__ = "GNU GPLv3"


# version: see version.py

import sys
Expand Down
4 changes: 4 additions & 0 deletions src/lbsntransform/version.py
@@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
"""Version of lbsntransform package"""

__version__ = '0.24.0'

0 comments on commit 3d1b724

Please sign in to comment.