Skip to content

Commit aab97b4

Browse files
authored
Remove versioneer and upload to test-pypi (#277)
Use versioningit for version management
1 parent c4ecd78 commit aab97b4

9 files changed

Lines changed: 80 additions & 3073 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ jobs:
134134
135135
- name: Test if install was successful
136136
run: |
137-
python3 -c "import pedpy; print(pedpy.__version__)"
137+
python3 -c "import pedpy; print(f'PedPy {pedpy.__version__} (SHA: {pedpy.__commit_hash__})')"
138138
139139
- name: Run getting started notebook
140140
run: |
@@ -149,8 +149,7 @@ jobs:
149149
jupyter nbconvert --to notebook --execute fundamental_diagram.ipynb
150150
151151
publish:
152-
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') ||
153-
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags'))}}
152+
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags')}}
154153
needs: [ build, test ]
155154
strategy:
156155
fail-fast: false
@@ -166,15 +165,7 @@ jobs:
166165
name: dist
167166
path: dist/
168167

169-
- name: Publish package to test PyPi
170-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
171-
uses: pypa/gh-action-pypi-publish@release/v1
172-
with:
173-
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
174-
repository_url: https://test.pypi.org/legacy/
175-
176168
- name: Publish package to PyPi
177-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
178169
uses: pypa/gh-action-pypi-publish@release/v1
179170
with:
180171
password: ${{ secrets.PYPI_API_TOKEN }}

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,16 @@ To install the latest **stable** version of *PedPy* and its dependencies from Py
4040
python3 -m pip install pedpy
4141
```
4242

43-
If you want to install the current version in the repository which might be unstable, you can do so via:
43+
You can also install the latest version of *PedPy* directly from the repository, by following these steps:
44+
45+
1. Uninstall an installed version of *PedPy*:
4446
```bash
45-
python3 -m pip install --pre --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ pedpy
47+
python3 -m pip uninstall pedpy
48+
```
49+
50+
2. Install latest version of *PedPy* from repository:
51+
```
52+
python3 -m pip install git+https://github.com/PedestrianDynamics/PedPy.git
4653
```
4754

4855
### Usage

pedpy/__init__.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
# type: ignore
22
"""Top level imports, for easier usage."""
3-
from . import _version
3+
try:
4+
from . import _version # pylint: disable=import-self
5+
6+
__version__ = _version.__version__
7+
__commit_hash__ = _version.__commit_hash__
8+
9+
except ImportError:
10+
__version__ = "unknown"
11+
__commit_hash__ = "unknown"
12+
413
from .data.geometry import MeasurementArea, MeasurementLine, WalkableArea
514
from .data.trajectory_data import TrajectoryData
615
from .io.trajectory_loader import (
@@ -67,8 +76,6 @@
6776
plot_walkable_area,
6877
)
6978

70-
__version__ = _version.get_versions()["version"]
71-
7279
__all__ = [
7380
"MeasurementArea",
7481
"MeasurementLine",

0 commit comments

Comments
 (0)