bugfix "make publish"

This commit is contained in:
JensDiemer 2020-12-28 20:20:34 +01:00
parent 28f2badcfc
commit 2502bd73bf
3 changed files with 32 additions and 2 deletions

View file

@ -45,7 +45,7 @@ pytest: install ## Run pytest
poetry run python3 ./run_pytest.py
publish: ## Release new version to PyPi
poetry run publish
poetry run python3 ./publish.py
local-test: install ## Run local_test.py to run the project locally
poetry run python3 ./local_test.py

31
publish.py Normal file
View file

@ -0,0 +1,31 @@
from pathlib import Path
from poetry_publish.publish import poetry_publish
from poetry_publish.utils.subprocess_utils import verbose_check_call
import django_ynh
from django_ynh.path_utils import assert_is_file
PACKAGE_ROOT = Path(django_ynh.__file__).parent.parent.parent
def publish():
"""
Publish to PyPi
Call this via:
$ make publish
"""
assert_is_file(PACKAGE_ROOT / 'README.md')
verbose_check_call('make', 'pytest') # don't publish if tests fail
verbose_check_call('make', 'fix-code-style') # don't publish if code style wrong
poetry_publish(
package_root=PACKAGE_ROOT,
version=django_ynh.__version__,
creole_readme=True, # don't publish if README.rst is not up-to-date
)
if __name__ == '__main__':
publish()

View file

@ -39,7 +39,6 @@ build-backend = "poetry.core.masonry.api"
[tool.poetry.scripts]
create_superuser = "django_ynh.create_superuser:main"
publish = "django_ynh_tests.test_project.publish:publish"
[tool.isort]
# https://pycqa.github.io/isort/docs/configuration/config_files/#pyprojecttoml-preferred-format