From 2e42b89fc1f2d4819d221f611c718d4f2b55a76e Mon Sep 17 00:00:00 2001 From: ninjinkun Date: Thu, 17 Dec 2020 14:50:09 +0900 Subject: [PATCH 1/7] feature: grab module version from Git tag --- launchable/version.py | 8 +++++++- requirements.txt | 3 ++- setup.py | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/launchable/version.py b/launchable/version.py index 1c98a23a8..8b4d8415a 100644 --- a/launchable/version.py +++ b/launchable/version.py @@ -1 +1,7 @@ -__version__ = '0.1.9' +from pkg_resources import get_distribution, DistributionNotFound + +try: + __version__ = get_distribution("launchable").version +except DistributionNotFound: + # package is not installed + pass \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index aa9c18e50..562f94301 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ click==7.1.2 requests==2.24.0 -junitparser==1.6.3 \ No newline at end of file +junitparser==1.6.3 +setuptools==51.0.0 \ No newline at end of file diff --git a/setup.py b/setup.py index da3ceb88e..5940d923d 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,4 @@ from setuptools import setup, find_packages -from launchable.version import __version__ from os import path this_directory = path.abspath(path.dirname(__file__)) @@ -13,7 +12,6 @@ def _requirements(file): setup( name='launchable', - version=__version__, license='Apache Software License v2', author='Launchable, Inc.', url='https://launchableinc.com/', @@ -24,6 +22,8 @@ def _requirements(file): install_requires=_requirements('requirements.txt'), packages=find_packages(), package_data={'launchable': ['jar/exe_deploy.jar']}, + setup_require=['setuptools_scm'], + use_scm_version=True, entry_points={ 'console_scripts': [ 'launchable = launchable.__main__:main', From c32de253a97a9932ede480370a4f51c5f7581b02 Mon Sep 17 00:00:00 2001 From: ninjinkun Date: Thu, 17 Dec 2020 14:59:57 +0900 Subject: [PATCH 2/7] fix: add setuptools-scm dependency to the publish action --- .github/workflows/python-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 4e1ef42d2..917985e40 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -21,7 +21,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install setuptools wheel twine + pip install setuptools setuptools_scm wheel twine - name: Build and publish env: TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} From c3c9edb6dc0c04dafa31afcd04444726220b1bf4 Mon Sep 17 00:00:00 2001 From: ninjinkun Date: Thu, 17 Dec 2020 15:19:31 +0900 Subject: [PATCH 3/7] fix: setuptools version --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 562f94301..c7e1656fe 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ click==7.1.2 requests==2.24.0 junitparser==1.6.3 -setuptools==51.0.0 \ No newline at end of file +setuptools>=50.0.0 \ No newline at end of file From 6711b1bb343ef7933a52bf0b85735043cfc5f3a8 Mon Sep 17 00:00:00 2001 From: ninjinkun Date: Thu, 17 Dec 2020 15:31:44 +0900 Subject: [PATCH 4/7] fix: add build line to test action --- .github/workflows/python-package.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 2e99916ba..95b8cb4ef 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -26,8 +26,10 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 nose + pip install flake8 nose setuptools setuptools_scm if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Build + run: python setup.py sdist bdist_wheel - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names From cd7d5ee5127a1fc2f4e5ceb4e7fd71e2b54dddd4 Mon Sep 17 00:00:00 2001 From: ninjinkun Date: Thu, 17 Dec 2020 15:33:52 +0900 Subject: [PATCH 5/7] fix: test --- .github/workflows/python-package.yml | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 95b8cb4ef..a2791886a 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -26,7 +26,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 nose setuptools setuptools_scm + pip install flake8 nose setuptools setuptools_scm wheel if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Build run: python setup.py sdist bdist_wheel diff --git a/requirements.txt b/requirements.txt index c7e1656fe..c3f761094 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ click==7.1.2 requests==2.24.0 junitparser==1.6.3 -setuptools>=50.0.0 \ No newline at end of file +setuptools \ No newline at end of file From 2ba04122602760d5c2318f6a100a22b67e1be9d6 Mon Sep 17 00:00:00 2001 From: ninjinkun Date: Thu, 17 Dec 2020 15:36:11 +0900 Subject: [PATCH 6/7] fix: test --- .github/workflows/python-package.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index a2791886a..78ac00236 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -29,7 +29,9 @@ jobs: pip install flake8 nose setuptools setuptools_scm wheel if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Build - run: python setup.py sdist bdist_wheel + run: | + python setup.py sdist bdist_wheel + pip install -U . - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names From 6c8a672758d44a7226958208f55d4fb4db63f095 Mon Sep 17 00:00:00 2001 From: ninjinkun Date: Thu, 17 Dec 2020 16:17:58 +0900 Subject: [PATCH 7/7] feature: add readme line --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index cc98ae8d7..17c600095 100644 --- a/README.md +++ b/README.md @@ -77,3 +77,7 @@ launchable_verify: name: launchable verify? command: launchable verify || true ``` + +# How to release +Create new release on Github, then Github Actions automatically uploads the module to PyPI. +