Helper to build and upload a project that used poetry to PyPi, with prechecks
Project description
about poetry-publish
Helper to build and upload a project that used poetry to PyPi, with prechecks:
User must confirm:
If __version__ contains ‘dev’ or ‘rc’
If git repository is not on master
Abort publish if git repository contains changes
Abort if git repository is not up-to-date
Abort if poetry check fails
Abort if git version tag already exists
After a successfull upload to PyPi:
create a git version tag
git push tag to remote server
Compatible Python Versions (see tox.ini or .travis.yml):
3.8, 3.7, 3.6
PyPy3
usage
Create a publish hook in you project, e.g. create your_project/publish.py with:
from pathlib import Path import your_project from poetry_publish.publish import poetry_publish def publish(): poetry_publish( package_root=Path(your_project.__file__).parent.parent, version=your_project.__version__, )
Add this to your poetry pyproject.toml, e.g.:
[tool.poetry.scripts] publish = 'your_project:publish'
To publish do this:
~$ cd your_project ~/your_project$ poetry run publish
Note: Don’t miss the run ! It’s not the same as poetry publish
based on: https://github.com/jedie/python-code-snippets/blob/master/CodeSnippets/setup_publish.py
unittests
# clone repository (or use your fork): ~$ git clone https://github.com/jedie/poetry-publish.git ~$ cd poetry-publish # install or update poetry: ~/poetry-publish$ make install-poetry # install poetry-publish via poetry: ~/poetry-publish$ make install # Run pytest: ~/poetry-publish$ make pytest # Run pytest via tox with all environments: ~/poetry-publish$ make tox # Run pytest via tox with one Python version: ~/poetry-publish$ make tox-py38 ~/poetry-publish$ make tox-py37 ~/poetry-publish$ make tox-py36
make targets
To see all make targets, just call make:
~/poetry-publish$ make help List all commands install-poetry install or update poetry install install poetry-publish via poetry lint Run code formatters and linter fix-code-style Fix code formatting tox-listenvs List all tox test environments tox Run pytest via tox with all environments tox-py36 Run pytest via tox with *python v3.6* tox-py37 Run pytest via tox with *python v3.7* tox-py38 Run pytest via tox with *python v3.8* pytest Run pytest update-rst-readme update README.rst from README.creole publish Release new version to PyPi
history
dev - compare v0.2.2…master
TBC
v0.2.2 - 2020-02-01 - compare v0.2.1…v0.2.2
Fix missing project description on PyPi
v0.2.1 - 2020-02-01 - compare v0.2.0…v0.2.1
call “poetry version” after “branch is master” check
add many tests
test with PyPy v3, too
Upload coverage reports
fix code style
update README
v0.2.0 - 2020-02-01 - compare 92e584…v0.2.0
first released version cut out from python-creole
first source code was written 27.11.2008: Forum thread (de)
Project links
GitHub |
|
PyPi |
donation
Note: this file is generated from README.creole 2020-02-01 22:16:57 with "python-creole"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for poetry_publish-0.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0d29335af89f15c7387d34b0dfa2b69aa889760e219dc0acac84d518c161594 |
|
MD5 | a5471623ff9aaed00d727ac6694028e2 |
|
BLAKE2b-256 | 4572be8e2b74113f51bc3770290ac3012900914d0cdf34e2ff19c8f2459570e2 |