mirror of
https://github.com/YunoHost-Apps/django_example_ynh.git
synced 2024-09-03 18:26:21 +02:00
bugfix "make publish"
This commit is contained in:
parent
28f2badcfc
commit
2502bd73bf
3 changed files with 32 additions and 2 deletions
2
Makefile
2
Makefile
|
@ -45,7 +45,7 @@ pytest: install ## Run pytest
|
||||||
poetry run python3 ./run_pytest.py
|
poetry run python3 ./run_pytest.py
|
||||||
|
|
||||||
publish: ## Release new version to PyPi
|
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
|
local-test: install ## Run local_test.py to run the project locally
|
||||||
poetry run python3 ./local_test.py
|
poetry run python3 ./local_test.py
|
||||||
|
|
31
publish.py
Normal file
31
publish.py
Normal 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()
|
|
@ -39,7 +39,6 @@ build-backend = "poetry.core.masonry.api"
|
||||||
|
|
||||||
[tool.poetry.scripts]
|
[tool.poetry.scripts]
|
||||||
create_superuser = "django_ynh.create_superuser:main"
|
create_superuser = "django_ynh.create_superuser:main"
|
||||||
publish = "django_ynh_tests.test_project.publish:publish"
|
|
||||||
|
|
||||||
[tool.isort]
|
[tool.isort]
|
||||||
# https://pycqa.github.io/isort/docs/configuration/config_files/#pyprojecttoml-preferred-format
|
# https://pycqa.github.io/isort/docs/configuration/config_files/#pyprojecttoml-preferred-format
|
||||||
|
|
Loading…
Add table
Reference in a new issue