Skip to content

Commit

Permalink
Add undrdg to Pypi (pip)
Browse files Browse the repository at this point in the history
  • Loading branch information
aMarcireau committed Oct 8, 2023
1 parent a4f784b commit 0e00aa9
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 9 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/publish_python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish Python

on:
release:
types:
- published

jobs:
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- run: python setup.py sdist
working-directory: python
- uses: actions/upload-artifact@v3
with:
name: undr-sdist
path: python/dist/*.tar.gz
upload_pypi:
name: Upload to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: undr-sdist
path: dist
- uses: pypa/gh-action-pypi-publish@v1.5.0
with:
password: ${{ secrets.PYPI_API_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ __pycache__
*.egg-info
scripts/**/input
scripts/**/output
dist
31 changes: 27 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,38 @@
# undrdg
UNDRDG provides building blocks to convert existing datasets to the UNDR format.

UNDR Dataset Generator
The scripts used to convert the datasets that we re-distribute can be found in _scripts_. The converted datasets can be browsed at https://www.undr.space.

## Contribute
# Use UNDRDG in your own project

```sh
python3 -m pip install undrdg
```

See _scripts_ for usage examples.

# Add scripts to this directory

```sh
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
pip install -r scripts/requirements.txt
```

# Contribute to UNDRDG

1. Install the development version

```sh
python3 -m venv .venv
source .venv/bin/activate
pip remove undrdg # to avoid name clashes
pip install -e .
```

2. Edit files in _undrg_. Changes are automatically reflected in scripts that import the library.

3. Format and lint.

```sh
isort .; black .; pyright .
```
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools >= 42"]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
Expand All @@ -10,14 +10,13 @@ authors = [
description = "Generate datasets compatible with UNDR"
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
]
dependencies = ["undr"]
dynamic = ["version", "readme"]

[tool.setuptools.dynamic]
version = {attr = "undrdg.__version__"}
version = {attr = "undrdg.version.__version__"}
readme = {file = ["README.md"], content-type = "text/markdown"}

[tool.isort]
Expand Down
1 change: 1 addition & 0 deletions scripts/dvs09/dvs09.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Before running this script, download the original dataset from http://sensors.ini.uzh.ch/databases.html.
# Create the directories 'input' and 'output' next to this file.
# Move the unzipped 'DVS09 - DVS128 sample data' directory in the 'input' directory.
# The file structure should be as follows.
#
# dvs09/
# ├─ input/
Expand Down
2 changes: 1 addition & 1 deletion scripts/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
matplotlib
#undrdg
undrdg
2 changes: 1 addition & 1 deletion undrdg/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = "0.1.0"
__version__ = "0.1.1"
"""UNDRDG's version, conforms to Semantic Versioning 2.0.0.
"""

0 comments on commit 0e00aa9

Please sign in to comment.