Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/2056 update metadata in pyprojecttoml #489

Closed
wants to merge 45 commits into from
Closed
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
10536d3
Update metadata in pyproject.toml
randy-seng Mar 21, 2024
acbe904
Specify OTAnalytics as package in pyproject.toml
randy-seng Mar 22, 2024
3c4d98e
Add pypa's build to dev dependencies to build distribution
randy-seng Mar 22, 2024
d1c5c4c
Add twine to dev dependencies to upload distribution to PyPI or TestPyPI
randy-seng Mar 22, 2024
2686505
Add GitHub workflow to publish OTAnalytics to TestPypi
randy-seng Mar 22, 2024
7c6032e
Only publish to TestPyPI when test workflow succeeds
randy-seng Mar 22, 2024
3d6c550
Match pyproject.toml project name to TestPyPI project name
randy-seng Mar 22, 2024
570c602
Change python version in publish-testpypi.yml workflow and remove tes…
randy-seng Mar 22, 2024
2bf4d91
Fix project name to match TestPyPI project URL defined in publish-tes…
randy-seng Mar 22, 2024
20961db
Fix publish-testpypi.yml not working
randy-seng Mar 22, 2024
33337ff
Enable dynamic versioning
randy-seng Mar 25, 2024
1efd5fd
Use dummy value for package version
randy-seng Mar 25, 2024
9bcc952
Fix dummy value for package version
randy-seng Mar 25, 2024
24e2085
Clear dist folder
randy-seng Mar 25, 2024
7059e3b
Add workflow name
randy-seng Mar 25, 2024
023d7c8
Bump version number
randy-seng Mar 25, 2024
9d2a602
Log dist content
randy-seng Mar 25, 2024
705ce69
Add more debug logs
randy-seng Mar 25, 2024
14f2286
Manually patch version file
randy-seng Mar 25, 2024
130d63e
Choose correct version matching version scheme
randy-seng Mar 25, 2024
b674f1b
Choose correct version matching version scheme
randy-seng Mar 25, 2024
09600ed
Fix patching version number
randy-seng Mar 25, 2024
94a8228
Give meaningful name for workflow step
randy-seng Mar 25, 2024
51e3496
Merge branch 'main' into feature/2056-update-metadata-in-pyprojecttoml
randy-seng Mar 25, 2024
bdc6e4d
Merge branch 'main' into feature/2056-update-metadata-in-pyprojecttoml
briemla Apr 3, 2024
67a50b0
Increase version number to get latest OTAnalytics
briemla Apr 3, 2024
1ab94d1
Merge branch 'main' into feature/2056-update-metadata-in-pyprojecttoml
briemla Apr 4, 2024
f083eeb
Merge branch 'main' into feature/2056-update-metadata-in-pyprojecttoml
briemla Apr 15, 2024
26f282f
Merge branch 'main' into feature/2056-update-metadata-in-pyprojecttoml
briemla Apr 16, 2024
8a1ff27
Increase version for new release on test.pypi.org
briemla Apr 16, 2024
85e8f1c
Merge branch 'main' into feature/2056-update-metadata-in-pyprojecttoml
briemla Apr 24, 2024
3db58d3
Update to latest OTAnalytics
briemla Apr 24, 2024
87751c9
Merge branch 'main' into feature/2056-update-metadata-in-pyprojecttoml
briemla Apr 30, 2024
f561f77
Merge remote-tracking branch 'origin/bug/4710-bbox-in-miovision-video…
briemla Apr 30, 2024
8b4ec25
Increase version
briemla Apr 30, 2024
415f481
Clean up code and add tests
briemla May 2, 2024
5832e6c
Clean up code
briemla May 2, 2024
6a658c5
Use correct frame offset.
briemla May 2, 2024
518b60d
Merge remote-tracking branch 'origin/bug/4710-bbox-in-miovision-video…
briemla May 7, 2024
6350f6b
Increase version number for latest bug fixes
briemla May 7, 2024
d89c70b
Merge remote-tracking branch 'origin/bug/4710-bbox-in-miovision-video…
briemla May 7, 2024
b6979d3
Update version number
briemla May 7, 2024
84bc439
Merge branch 'main' into feature/2056-update-metadata-in-pyprojecttoml
briemla May 8, 2024
8023c3f
Update version number
briemla May 8, 2024
9d0b86f
Merge remote-tracking branch 'origin/feature/2056-update-metadata-in-…
briemla May 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .github/workflows/publish-testpypi.yml
briemla marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
# This workflow will install Python dependencies, run tests

name: Publish on TestPyPI

on: push

jobs:
build-n-publish:
# needs: test
name: Build and upload release to TestPyPI
runs-on: ${{ matrix.os }}
strategy:
fail-fast: True
matrix:
os: [ubuntu-latest]
python-version: ["3.11"]
environment:
name: testpypi
url: https://test.pypi.org/p/OTAnalytics-EXAMPLE-TEST-DISTRIBUTION
permissions:
actions: read
contents: read
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Check-out platomo-build repository
uses: actions/checkout@v4
with:
repository: platomo/platomo-build
token: ${{ secrets.PLATOMO_BUILDER_ACCESS }}
path: platomo-build
- name: Install builder dependencies
run: |
cd platomo-build
python -m pip install --upgrade pip
if [ -f "requirements.txt" ]; then
pip install -r requirements.txt
fi
if [ -f "requirements-dev.txt" ]; then
pip install -r requirements-dev.txt
fi
- name: Build release assets
run: python ./platomo-build/build.py --package_version 0.0.0.0.5.a1
- name: Display dist content
run: ls -ahl dist/
- name: Display version info
run: cat OTAnalytics/version.py
- name: Patch version
run: echo __version__ = \"0.0.0.0.5.a1\" > OTAnalytics/version.py
- name: Remove File
uses: JesseTG/rm@v1.0.3
with:
path: dist/
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to build os dependend wheels? At least mac os arm and x64 need to be different, don't they?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python3 -m build --wheel
The wheel package will detect that the code is not pure Python, and build a wheel that’s named such that it’s only usable on the platform that it was built on. For details on the naming of wheel files, see PEP 425.

The Python build module will take care of that one. In our case, we only build a pure python wheel, because we do not use platform specific extensions ourself. Our dependencies will use platform specific extension which will be installed by pip.

run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Show dist content
run: ls -ahl dist/
- name: Publish package distributions to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
verbose: true
31 changes: 28 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,41 @@ requires = ["hatchling", "hatch-requirements-txt"]
build-backend = "hatchling.build"

[project]
name = "OTAnalytics"
version = "0.0.1"
dynamic = ["dependencies"]
name = "OTAnalytics-EXAMPLE-TEST-DISTRIBUTION"
dynamic = ["dependencies", "version"]
authors = [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use a generic { name="OpenTrafficCam Contributors", email="team@opentrafficcam.org" }?

{ name="Martin Bärwolff", email="martin.baerwolff@platomo.com" },
{ name="Lars Briem", email="lars.briem@platomo.com" },
{ name="Sebastian Buck", email="sebastian.buck@platomo.com" },
{ name="Michael Heilig", email="michael.heilig@platomo.com" },
{ name="Randy Seng", email="randy.seng@platomo.com" },
{ name="Steven Schlechte", email="steven.schlechte@platomo.com" },
]
description = "OTAnalytics is a core module of the OpenTrafficCam framework to perform traffic analysis on trajectories of road users."
readme = "README.md"
requires-python = ">=3.11"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
]
keywords = ["OpenTrafficCam", "Traffic Analysis", "Traffic Counting"]

[project.urls]
Homepage = "https://opentrafficcam.org/"
Documentation = "https://opentrafficcam.org/overview/"
Repository = "https://github.com/OpenTrafficCam/OTAnalytics"
Issues = "https://github.com/OpenTrafficCam/OTAnalytics/issues"

[tool.hatch.metadata.hooks.requirements_txt]
files = ["requirements.txt"]

[tool.hatch.version]
path = "OTAnalytics/version.py"

[tool.hatch.build.targets.wheel]
packages = ["OTAnalytics"]

[tool.black]
line-length = 88

Expand Down
3 changes: 3 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
-r requirements.txt
black==24.2.0
build==1.1.1
flake8==7.0.0
hatch-requirements-txt==0.4.1
interrogate==1.5.0
isort==5.13.2
mypy==1.8.0
pre-commit==3.6.2
pytest==8.0.0
pytest-benchmark==4.0.0
pytest-cov==4.1.0
twine==5.0.0
yamllint==1.35.1
Loading