Skip to content

Commit

Permalink
Remove versioneer and upload to test-pypi (#277)
Browse files Browse the repository at this point in the history
Use versioningit for version management
  • Loading branch information
schroedtert authored Mar 12, 2024
1 parent c4ecd78 commit aab97b4
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 3,073 deletions.
13 changes: 2 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ jobs:
- name: Test if install was successful
run: |
python3 -c "import pedpy; print(pedpy.__version__)"
python3 -c "import pedpy; print(f'PedPy {pedpy.__version__} (SHA: {pedpy.__commit_hash__})')"
- name: Run getting started notebook
run: |
Expand All @@ -149,8 +149,7 @@ jobs:
jupyter nbconvert --to notebook --execute fundamental_diagram.ipynb
publish:
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') ||
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags'))}}
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags')}}
needs: [ build, test ]
strategy:
fail-fast: false
Expand All @@ -166,15 +165,7 @@ jobs:
name: dist
path: dist/

- name: Publish package to test PyPi
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/

- name: Publish package to PyPi
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,16 @@ To install the latest **stable** version of *PedPy* and its dependencies from Py
python3 -m pip install pedpy
```

If you want to install the current version in the repository which might be unstable, you can do so via:
You can also install the latest version of *PedPy* directly from the repository, by following these steps:

1. Uninstall an installed version of *PedPy*:
```bash
python3 -m pip install --pre --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ pedpy
python3 -m pip uninstall pedpy
```

2. Install latest version of *PedPy* from repository:
```
python3 -m pip install git+https://github.com/PedestrianDynamics/PedPy.git
```

### Usage
Expand Down
13 changes: 10 additions & 3 deletions pedpy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# type: ignore
"""Top level imports, for easier usage."""
from . import _version
try:
from . import _version # pylint: disable=import-self

__version__ = _version.__version__
__commit_hash__ = _version.__commit_hash__

except ImportError:
__version__ = "unknown"
__commit_hash__ = "unknown"

from .data.geometry import MeasurementArea, MeasurementLine, WalkableArea
from .data.trajectory_data import TrajectoryData
from .io.trajectory_loader import (
Expand Down Expand Up @@ -67,8 +76,6 @@
plot_walkable_area,
)

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

__all__ = [
"MeasurementArea",
"MeasurementLine",
Expand Down
Loading

0 comments on commit aab97b4

Please sign in to comment.