Skip to content

Commit e0f8ea5

Browse files
Merge branch 'main' into cuda-ransac
# Conflicts: # .github/workflows/test.yml
2 parents 2b1adbd + fa4ac29 commit e0f8ea5

File tree

5 files changed

+123
-15
lines changed

5 files changed

+123
-15
lines changed

.github/workflows/publish.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Publish pip on PyPi
2+
3+
on: workflow_dispatch
4+
5+
jobs:
6+
publish-to-production-pypi:
7+
strategy:
8+
matrix:
9+
os: [ ubuntu-latest ]
10+
python-version: [ "3.9" ]
11+
12+
runs-on: ${{ matrix.os }}
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v3
17+
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v3
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install -r requirements.txt
27+
pip install poetry
28+
29+
- name: Publish to production PyPI
30+
run: |
31+
poetry version $(git describe --tags --abbrev=0)
32+
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
33+
poetry publish --build

.github/workflows/python-package.yml renamed to .github/workflows/test.yml

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
branches: [ "main" ]
88

99
jobs:
10-
build:
10+
lints-and-tests:
1111

1212
runs-on: ubuntu-latest
1313
strategy:
@@ -45,4 +45,37 @@ jobs:
4545
pip install .
4646
pytest
4747
env:
48-
NUMBA_ENABLE_CUDASIM: 1
48+
NUMBA_ENABLE_CUDASIM: 1
49+
50+
publish-package:
51+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
52+
needs: lints-and-tests
53+
54+
strategy:
55+
matrix:
56+
os: [ ubuntu-latest ]
57+
python-version: [ "3.9" ]
58+
59+
runs-on: ${{ matrix.os }}
60+
61+
steps:
62+
- name: Checkout repository
63+
uses: actions/checkout@v3
64+
65+
- name: Set up Python ${{ matrix.python-version }}
66+
uses: actions/setup-python@v3
67+
with:
68+
python-version: ${{ matrix.python-version }}
69+
70+
- name: Install dependencies
71+
run: |
72+
python -m pip install --upgrade pip
73+
pip install -r requirements.txt
74+
pip install poetry
75+
76+
- name: Publish to test PyPI
77+
run: |
78+
poetry version $(git describe --tags --abbrev=0)
79+
poetry config repositories.test-pypi https://test.pypi.org/legacy/
80+
poetry config pypi-token.test-pypi ${{ secrets.TEST_PYPI_TOKEN }}
81+
poetry publish -r test-pypi --build

DEVELOP.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Publish package to PyPi
2+
3+
Firstly you have to ensure, that package properly builds, publishes and works.
4+
To do this, you must first publish it on https://test.pypi.org
5+
6+
1. Create tag on main branch:
7+
```commandline
8+
git tag <tagname>
9+
```
10+
2. Push created tag to repository
11+
```commandline
12+
git push origin <tagname>
13+
```
14+
After this GitHubActions will automatically build pip package and push it to test PyPi registry
15+
3. Ensure, that installed pip package from https://test.pypi.org works properly
16+
```commandline
17+
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple octreelib==<tagname>
18+
```
19+
4. Publish pip package manually on production PyPi using the following steps:
20+
- Go to Actions page
21+
- Go to "Publish pip on PyPi" workflow on left side of the screen
22+
- Go to "Run workflow" and choose last tag which has been created from tags
23+
- Click "Run workflow"
24+
25+
After this GitHubActions will automatically build pip package and push it to test production registry

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Octreelib
22

3-
[![tests](https://github.com/prime-slam/octreelib/actions/workflows/python-package.yml/badge.svg?branch=main)](https://github.com/prime-slam/octreelib/actions/workflows/python-package.yml)
3+
[![tests](https://github.com/prime-slam/octreelib/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/prime-slam/octreelib/actions/workflows/python-package.yml)
44
[![Code style: black](https://img.shields.io/badge/code%20style-black-black)]()
55
[![Code style: black](https://img.shields.io/badge/code%20style-flake8-black)]()
66
[![License: Apache License 2.0](https://img.shields.io/github/license/saltstack/salt)](https://opensource.org/license/apache-2-0/)
@@ -17,12 +17,12 @@ in the same grid synchronizing their subdivision schemes.
1717
To install the latest version of the library, run
1818

1919
```shell
20-
pip install git+https://github.com/prime-slam/octreelib
20+
pip install octreelib
2121
```
2222

23-
To install a specific version, use **tags**, for example tag `v0.0.3`
23+
To install a specific version, use **tags**, for example tag `0.0.1`
2424

2525
```shell
26-
pip install git+https://github.com/prime-slam/octreelib@v0.0.3
26+
pip install octreelib==0.0.1
2727
```
2828

pyproject.toml

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,30 @@
1-
[project]
1+
[tool.poetry]
22
name = "octreelib"
3-
dynamic = ["dependencies"]
4-
version = "0.0.5"
3+
version = "0.0.0"
4+
description = "Library for representing point clouds as OcTrees in SLAM"
5+
authors = [
6+
"Kiselyov Mikhail <kiselev.0353@gmail.com>",
7+
"Pavel Mokeev <pav3l.mokeev@gmail.com>"
8+
]
9+
license = "APACHE"
10+
readme = "README.md"
11+
homepage = "https://github.com/prime-slam/"
12+
repository = "https://github.com/prime-slam/octreelib"
13+
classifiers = [
14+
"License :: OSI Approved :: Apache Software License",
15+
"Intended Audience :: Developers",
16+
"Topic :: Software Development :: Libraries :: Python Modules",
17+
]
18+
exclude = ["test"]
519

6-
[tool.setuptools]
7-
include-package-data = false
20+
[tool.poetry.dependencies]
21+
python = "^3.9.0"
22+
numpy = "^1.26.0"
23+
k3d = "^2.16.0"
824

9-
[tool.setuptools.dynamic]
10-
dependencies = { file = ["requirements.txt"] }
25+
[tool.poetry.dev-dependencies]
26+
pytest = "^7.4.2"
1127

12-
[tool.setuptools.packages.find]
13-
exclude = ["test*"]
28+
[build-system]
29+
requires = ["poetry-core>=1.0.0"]
30+
build-backend = "poetry.core.masonry.api"

0 commit comments

Comments
 (0)