Skip to content

Commit

Permalink
exchange version string generation from versioneer to setuptools-scm (#…
Browse files Browse the repository at this point in the history
…549)

* use setuptools-scm for version generation
* add context to build-push-action
* add changes to other workflows
* update changelog
* add error_file to gitignore
  • Loading branch information
ekneg54 authored Mar 27, 2024
1 parent a326605 commit 2186732
Show file tree
Hide file tree
Showing 19 changed files with 65 additions and 738 deletions.
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ jobs:
with:
fetch-depth: 0

- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
Expand Down Expand Up @@ -166,8 +165,9 @@ jobs:

runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/publish-latest-dev-release-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ jobs:

runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
Expand All @@ -53,9 +54,10 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and Push Docker Image
uses: docker/build-push-action@v5
- name: Build images
uses: docker/build-push-action@v3
with:
context: .
push: true # Will only build if this is not here
build-args: |
LOGPREP_VERSION=latest
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/publish-release-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ jobs:
runs-on: ubuntu-latest
needs: publish-latest-release-to-pypi
steps:
- name: Checkout Code
uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
Expand All @@ -67,9 +68,10 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and Push Docker Image
uses: docker/build-push-action@v5
- name: Build images
uses: docker/build-push-action@v3
with:
context: .
push: true # Will only build if this is not here
build-args: |
LOGPREP_VERSION=${{ github.ref_name }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ logs
sql_db_table.json
build/
dist/
error_file
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,16 @@
* retrieve oauth token automatically from different oauth endpoints by introducing an additional file to
define the credentials for every configuration source

#### Improvements
### Improvements

* remove `versioneer` dependency in favor of `setuptools-scm`

### Bugfix

* fix version string of release versions
* fix version string of container builds for feature branches


## v10.0.4
### Improvements

Expand Down
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ RUN python -m pip install --upgrade pip wheel setuptools

RUN if [ "$LOGPREP_VERSION" = "dev" ]; then pip install .;\
elif [ "$LOGPREP_VERSION" = "latest" ]; then pip install git+https://github.com/fkie-cad/Logprep.git@latest; \
else pip install "logprep==$LOGPREP_VERSION"; fi
else pip install "logprep==$LOGPREP_VERSION"; fi; \
logprep --version


FROM python:${PYTHON_VERSION}-slim as prod
ARG http_proxy
Expand Down
4 changes: 0 additions & 4 deletions MANIFEST.in

This file was deleted.

6 changes: 3 additions & 3 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

sys.path.insert(0, os.path.abspath("../.."))

from logprep._version import get_versions
from importlib.metadata import version as get_versions

# -- Handlers ----------------------------------------------------------------

Expand All @@ -39,10 +39,10 @@ def setup(app):
author = "FKIE"

# The short X.Y version
full_version = get_versions()["version"].split(".")
full_version = get_versions("logprep").split(".")
version = f"{full_version[0]}.{full_version[1]}"
# The full version, including alpha/beta/rc tags
release = get_versions()["version"]
release = get_versions("logprep")


# -- General configuration ---------------------------------------------------
Expand Down
3 changes: 0 additions & 3 deletions logprep/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
from . import _version

__version__ = _version.get_versions()["version"]
Loading

0 comments on commit 2186732

Please sign in to comment.