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

Commit

Permalink
build setup from jinja template
Browse files Browse the repository at this point in the history
  • Loading branch information
dmachard committed Jun 23, 2021
1 parent 76a0d8f commit 6fc27fd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 29 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@ jobs:
python -m pip install --upgrade pip setuptools wheel
pip install twine jinja2
- id: pkg_version
run: echo "##[set-output name=data;]$(echo ${{ github.event.release.tag_name }} | cut -c2-)"

- name: Build Python package
run: |
python setup_init.py ${{ github.event.release.tag_name }}
python -c 'import jinja2;jinja2.Template(open("setup.j2").read()).stream(version="${{ steps.pkg_version.outputs.data }}").dump("setup.py")'
python setup.py sdist bdist_wheel
- name: Build the Docker image
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ jobs:
python -m pip install --upgrade pip setuptools wheel
pip install twine jinja2
- id: pkg_version
run: echo "##[set-output name=data;]$(echo ${{ github.event.release.tag_name }} | cut -c2-)"

- name: Build Python package
run: |
python setup_init.py ${{ github.event.release.tag_name }}
python -c 'import jinja2;jinja2.Template(open("setup.j2").read()).stream(version="${{ steps.pkg_version.outputs.data }}").dump("setup.py")'
python setup.py sdist bdist_wheel
- name: Twine check
Expand Down
2 changes: 1 addition & 1 deletion setup_template.j2 → setup.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ KEYWORDS = ('dnstap receiver client json yaml text')

setuptools.setup(
name="dnstap_receiver",
version="{{ pkg_version }}",
version="{{ version }}",
author="Denis MACHARD",
author_email="[email protected]",
description="Python Dnstap receiver",
Expand Down
26 changes: 0 additions & 26 deletions setup_init.py

This file was deleted.

0 comments on commit 6fc27fd

Please sign in to comment.