-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from pmokeev/main
feat(pip): migrate to publishing pip package using poetry
- Loading branch information
Showing
5 changed files
with
120 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Publish pip on PyPi | ||
|
||
on: workflow_dispatch | ||
|
||
jobs: | ||
publish-to-production-pypi: | ||
strategy: | ||
matrix: | ||
os: [ ubuntu-latest ] | ||
python-version: [ "3.9" ] | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- name: Publish to production PyPI | ||
run: | | ||
poetry version $(git describe --tags --abbrev=0) | ||
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }} | ||
poetry publish --build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Publish package to PyPi | ||
|
||
Firstly you have to ensure, that package properly builds, publishes and works. | ||
To do this, you must first publish it on https://test.pypi.org | ||
|
||
1. Create tag on main branch: | ||
```commandline | ||
git tag <tagname> | ||
``` | ||
2. Push created tag to repository | ||
```commandline | ||
git push origin <tagname> | ||
``` | ||
After this GitHubActions will automatically build pip package and push it to test PyPi registry | ||
3. Ensure, that installed pip package from https://test.pypi.org works properly | ||
```commandline | ||
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple octreelib==<tagname> | ||
``` | ||
4. Publish pip package manually on production PyPi using the following steps: | ||
- Go to Actions page | ||
- Go to "Publish pip on PyPi" workflow on left side of the screen | ||
- Go to "Run workflow" and choose last tag which has been created from tags | ||
- Click "Run workflow" | ||
After this GitHubActions will automatically build pip package and push it to test production registry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,30 @@ | ||
[project] | ||
[tool.poetry] | ||
name = "octreelib" | ||
dynamic = ["dependencies"] | ||
version = "0.0.5" | ||
version = "0.0.0" | ||
description = "Library for representing point clouds as OcTrees in SLAM" | ||
authors = [ | ||
"Kiselyov Mikhail <[email protected]>", | ||
"Pavel Mokeev <[email protected]>" | ||
] | ||
license = "APACHE" | ||
readme = "README.md" | ||
homepage = "https://github.com/prime-slam/" | ||
repository = "https://github.com/prime-slam/octreelib" | ||
classifiers = [ | ||
"License :: OSI Approved :: Apache Software License", | ||
"Intended Audience :: Developers", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
] | ||
exclude = ["test"] | ||
|
||
[tool.setuptools] | ||
include-package-data = false | ||
[tool.poetry.dependencies] | ||
python = "^3.9.0" | ||
numpy = "^1.26.0" | ||
k3d = "^2.16.0" | ||
|
||
[tool.setuptools.dynamic] | ||
dependencies = { file = ["requirements.txt"] } | ||
[tool.poetry.dev-dependencies] | ||
pytest = "^7.4.2" | ||
|
||
[tool.setuptools.packages.find] | ||
exclude = ["test*"] | ||
[build-system] | ||
requires = ["poetry-core>=1.0.0"] | ||
build-backend = "poetry.core.masonry.api" |