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

prepare for pypi #160

Merged
merged 4 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, '3.10', '3.11']
python-version: [3.7, 3.8, 3.9, '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v3
Expand Down
50 changes: 50 additions & 0 deletions maintenance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@

# PyPi upload

Package a Python Package/ version bump See: https://packaging.python.org/tutorials/packaging-projects/

1. Update `setup.py` to new version number
2. Commit this change
3. Tag and upload

## pypirc

Example `~/.pypirc` (see https://packaging.python.org/en/latest/specifications/pypirc/)
```
[distutils]
index-servers =
pypi
testpypi

[pypi]
username = __token__
password = <PyPI token>

[testpypi]
username = __token__
password = <TestPyPI token>
```

## Install dependencies:
```bash
pip install --upgrade setuptools
pip install --upgrade wheel
pip install --upgrade twine
# pip install --upgrade bleach html5lib # some versions do not work
pip install --upgrade bump2version
```

`bump2version` takes care to increase the version number, create the commit and tag.


## Publish

```bash
bump2version --verbose --tag patch # major, minor or patch
python setup.py sdist # bdist_wheel # It is difficult to get bdist_wheel working with binary files
git push origin --tags
# Wait for the github action to build the windows wheels, ToDO: Fix wheels.
twine upload --repository testpypi dist/* #
twine upload dist/*
git push
```
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build-system]
requires = ["setuptools", "wheel", "Cython", "numpy", "scipy"]
14 changes: 10 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
https://github.com/pypa/sampleproject
"""

# Allow editable install into user site directory.
# See https://github.com/pypa/pip/issues/7953.
import site
import sys
site.ENABLE_USER_SITE = '--user' in sys.argv[1:]

# To use a consistent encoding
from codecs import open
# Always prefer setuptools over distutils
Expand Down Expand Up @@ -54,10 +60,10 @@
long_description=long_description,

# The project's main homepage.
url='https://ei.uni-paderborn.de/nt/',
url='https://github.com/fgnt/padertorch/',

# Author details
author='Department of Communications Engineering',
author='Department of Communications Engineering, Paderborn University',
author_email='[email protected]',

# Choose your license
Expand All @@ -80,7 +86,7 @@

# Specify the Python versions you support here. In particular, ensure
# that you indicate whether you support Python 2, Python 3 or both.
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.10',
],

# What does your project relate to?
Expand All @@ -102,7 +108,7 @@
'natsort',
'lazy_dataset',
'IPython',
'paderbox @ git+http://github.com/fgnt/paderbox',
'paderbox',
],

# Installation problems in a clean, new environment:
Expand Down
Loading