Skip to content

Commit 0ecceb1

Browse files
Merge pull request #66 from EthanJamesLew/feature/versioning
Versioning and Automatic Deployment
2 parents 84a2064 + 3a8ebdb commit 0ecceb1

File tree

7 files changed

+725
-3
lines changed

7 files changed

+725
-3
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
autokoopman/_version.py export-subst

.github/workflows/publish.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Publish AutoKoopman
2+
3+
on: [push]
4+
5+
jobs:
6+
publish-whl:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
max-parallel: 5
10+
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Set up Python 3.9
14+
uses: actions/setup-python@v2
15+
with:
16+
python-version: 3.9
17+
- name: Add conda to system path
18+
run: |
19+
# $CONDA is an environment variable pointing to the root of the miniconda directory
20+
echo $CONDA/bin >> $GITHUB_PATH
21+
- name: Prepare build requirements
22+
run: >-
23+
python -m
24+
pip install
25+
build
26+
--user
27+
- name: Build a binary wheel and a source tarball
28+
run: >-
29+
python -m
30+
build
31+
--sdist
32+
--wheel
33+
--outdir dist/
34+
.
35+
- name: Publish distribution 📦 to Test PyPI
36+
if: startsWith(github.ref, 'refs/tags')
37+
uses: pypa/gh-action-pypi-publish@release/v1
38+
with:
39+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
40+
repository_url: https://test.pypi.org/legacy/
41+
- name: Publish distribution 📦 to PyPI
42+
if: startsWith(github.ref, 'refs/tags')
43+
uses: pypa/gh-action-pypi-publish@release/v1
44+
with:
45+
password: ${{ secrets.PYPI_API_TOKEN }}

autokoopman/__init__.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,16 @@
1111
"Sergiy Bogomolov",
1212
]
1313
__license__ = "GPLv3"
14-
__version__ = "0.21"
1514
__maintainer__ = "Ethan Lew"
1615
__email__ = "ethanlew16@gmail.com"
1716
__status__ = "Prototype"
1817

18+
# we auto-manage versions
19+
from ._version import get_versions
20+
21+
__version__ = get_versions()["version"]
22+
del get_versions
23+
1924
from autokoopman.autokoopman import auto_koopman
2025

2126
from autokoopman.core.system import (
@@ -30,3 +35,7 @@
3035
UniformTimeTrajectoriesData,
3136
UniformTimeTrajectory,
3237
)
38+
39+
from . import _version
40+
41+
__version__ = _version.get_versions()["version"]

0 commit comments

Comments
 (0)