Skip to content

Commit

Permalink
feat(pip): add pip package publication (#33)
Browse files Browse the repository at this point in the history
* feat(pip): add test PyPi package publication

* feat(pip): fix GHA pipeline

* feat(pip): fix numpy version

* fix(pip): back rename voxel-slam -> slam

* fix(ci): remove typos stage

* feat(project): migrate to sova project naming

* feat(md): updated DEVELOP.md

* feat(pip): new logo

* feat(pip): fix notebook

* feat(pip): change link to mrob wheel

* feat(pip): minor README fixes

* feat(pip): python only 3.10

* fix(pip): revert >3.10.0

* fix(pip): fix dependecies

* feat(pip): python 3.10.*

* feat(pip): mrob >=0.0.12

* feat(pip): removed last mentions of voxel-slam
  • Loading branch information
pmokeev authored Apr 14, 2024
1 parent 1feddc3 commit 0374e78
Show file tree
Hide file tree
Showing 68 changed files with 380 additions and 301 deletions.
46 changes: 0 additions & 46 deletions .github/workflows/lint.yaml

This file was deleted.

33 changes: 33 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish pip on PyPi

on: workflow_dispatch

jobs:
publish-to-production-pypi:
strategy:
matrix:
os: [ ubuntu-latest ]
python-version: [ "3.10" ]

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
pip install poetry
- name: Publish to production PyPI
run: |
poetry version $(git describe --tags --abbrev=0)
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
poetry publish --build
72 changes: 71 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,43 @@ name: Tests
on: [push]

jobs:
test-and-lint:
lint:
strategy:
matrix:
os: [ ubuntu-22.04 ]
python-version: [ "3.10" ]

runs-on: ${{ matrix.os }}

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Python${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- name: Check imports
uses: isort/isort-action@master
with:
configuration: "--settings-file=.isort.cfg --profile=black"

- name: Run flake8
uses: py-actions/flake8@v2

- name: Run black
uses: psf/black@stable
with:
options: "--check --verbose --diff --extend-exclude '__init__.py'"
version: "22.8.0"

tests:
strategy:
matrix:
os: [ ubuntu-22.04 ]
Expand All @@ -28,3 +64,37 @@ jobs:
- name: Run pytest
run: |
python -m pytest tests/
publish-package:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs: [lint, tests]

strategy:
matrix:
os: [ ubuntu-latest ]
python-version: [ "3.10" ]

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
pip install poetry
- name: Publish to test PyPI
run: |
poetry version $(git describe --tags --abbrev=0)
poetry config repositories.test-pypi https://test.pypi.org/legacy/
poetry config pypi-token.test-pypi ${{ secrets.TEST_PYPI_TOKEN }}
poetry publish -r test-pypi --build
25 changes: 25 additions & 0 deletions DEVELOP.md
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 sova==<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
43 changes: 17 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,43 @@
<img align="left" width="200" height="200" src="assets/logo.svg">
Voxel-slam repository is an open-source Python library designed for fast
<img src="assets/logo.png">
SOVA is a SLAM on Voxel Alignment and an open-source Python library, designed for fast
and adaptive comparison of different approaches to solving the voxel-based planar SLAM problem.

Our main goal is to provide extendable, simple and efficient interfaces for
testing various hypotheses, which include different subdivision/segmenter/backend criteria.
testing various voxel SLAM hypotheses, which include different subdivision/segmenter/backend criteria.

[![Linters](https://github.com/prime-slam/voxel-slam/actions/workflows/lint.yaml/badge.svg)](https://github.com/prime-slam/voxel-slam/actions/workflows/lint.yaml)
[![Linters](https://github.com/prime-slam/sova/actions/workflows/lint.yaml/badge.svg)](https://github.com/prime-slam/voxel-slam/actions/workflows/lint.yaml)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

- - -
# Installation

To use this library you need to download this repository and install necessary dependencies.
How to do this:
To use this library you need to:

1. Download and install Python 3.10 from the [official website](https://www.python.org/downloads/).
2. Clone this repository
```bash
git clone https://github.com/prime-slam/voxel-slam.git
```
3. Create and activate virtual environment
```bash
python3 -m venv venv && source venv/bin/activate
```
4. Install dependencies
```bash
pip install -r requirements.txt
```
If you want to use `MROBBackend` type, you have to install mrob library manually:
1. Download [wheels](https://github.com/prime-slam/mrob/actions/runs/6841598615) from source
2. Install mrob from wheels
```bash
pip3 install mrob --find-links=... --force-reinstall
```
2. Install pip package:
```bash
pip install sova
```
If you want to use `MROBBackend` robust optimisations, you have to install mrob library manually:
1. Download [wheel from source](https://drive.google.com/file/d/1rUdbybNvHx80ykr62aceAcBIPtlntWIz/view?usp=sharing)
2. Install mrob from wheels
```bash
python -m pip install mrob --no-index --find-links wheel/ --force-reinstall
```

Now you have everything you need to run your voxel-based pipeline.

# Examples

Examples of using the voxel-based pipeline are presented in the [`examples`](https://github.com/prime-slam/voxel-slam/tree/main/examples)
Examples of using the voxel-based pipeline are presented in the [`examples`](https://github.com/prime-slam/sova/tree/main/examples)
directory with the all necessary instructions of how to run them.

# Contributing

To contribute to the project you must:
1. Get to know the project structure:
```
slam
sova
├── backend
├── filter
├── pipeline
Expand Down
2 changes: 0 additions & 2 deletions _typos.toml

This file was deleted.

Binary file added assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 0 additions & 21 deletions assets/logo.svg

This file was deleted.

4 changes: 2 additions & 2 deletions examples/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
import sys

sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from slam.pipeline import (
from sova.pipeline import (
SequentialPipeline,
SequentialPipelineRuntimeParameters,
YAMLConfigurationReader,
)
from slam.utils import (
from sova.utils import (
DatasetReader,
HiltiReader,
KittiReader,
Expand Down
6 changes: 3 additions & 3 deletions examples/segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
import sys

sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from slam.segmenter import RansacSegmenter
from slam.subdivider import SizeSubdivider
from slam.utils import HiltiReader, KittiReader, NuscenesReader, Reader
from sova.segmenter import RansacSegmenter
from sova.subdivider import SizeSubdivider
from sova.utils import HiltiReader, KittiReader, NuscenesReader, Reader

if __name__ == "__main__":
parser = argparse.ArgumentParser(prog="Segmentation")
Expand Down
Loading

0 comments on commit 0374e78

Please sign in to comment.