Skip to content
This repository was archived by the owner on Nov 14, 2022. It is now read-only.

Commit 6fc27fd

Browse files
committed
build setup from jinja template
1 parent 76a0d8f commit 6fc27fd

File tree

4 files changed

+9
-29
lines changed

4 files changed

+9
-29
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,12 @@ jobs:
2020
python -m pip install --upgrade pip setuptools wheel
2121
pip install twine jinja2
2222
23+
- id: pkg_version
24+
run: echo "##[set-output name=data;]$(echo ${{ github.event.release.tag_name }} | cut -c2-)"
25+
2326
- name: Build Python package
2427
run: |
25-
python setup_init.py ${{ github.event.release.tag_name }}
28+
python -c 'import jinja2;jinja2.Template(open("setup.j2").read()).stream(version="${{ steps.pkg_version.outputs.data }}").dump("setup.py")'
2629
python setup.py sdist bdist_wheel
2730
2831
- name: Build the Docker image

.github/workflows/publish.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@ jobs:
1616
python -m pip install --upgrade pip setuptools wheel
1717
pip install twine jinja2
1818
19+
- id: pkg_version
20+
run: echo "##[set-output name=data;]$(echo ${{ github.event.release.tag_name }} | cut -c2-)"
21+
1922
- name: Build Python package
2023
run: |
21-
python setup_init.py ${{ github.event.release.tag_name }}
24+
python -c 'import jinja2;jinja2.Template(open("setup.j2").read()).stream(version="${{ steps.pkg_version.outputs.data }}").dump("setup.py")'
2225
python setup.py sdist bdist_wheel
2326
2427
- name: Twine check

setup_template.j2 renamed to setup.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ KEYWORDS = ('dnstap receiver client json yaml text')
99

1010
setuptools.setup(
1111
name="dnstap_receiver",
12-
version="{{ pkg_version }}",
12+
version="{{ version }}",
1313
author="Denis MACHARD",
1414
author_email="[email protected]",
1515
description="Python Dnstap receiver",

setup_init.py

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)