Skip to content

Commit

Permalink
Merge pull request #58 from launchableinc/auto-versioning
Browse files Browse the repository at this point in the history
Grab module version from Git tag
  • Loading branch information
ninjinkun authored Dec 17, 2020
2 parents cbe2884 + 6c8a672 commit fd9cad5
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 6 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 nose
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
pip install -U .
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

8 changes: 7 additions & 1 deletion launchable/version.py
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
click==7.1.2
requests==2.24.0
junitparser==1.6.3
junitparser==1.6.3
setuptools
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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__))
Expand All @@ -13,7 +12,6 @@ def _requirements(file):

setup(
name='launchable',
version=__version__,
license='Apache Software License v2',
author='Launchable, Inc.',
url='https://launchableinc.com/',
Expand All @@ -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',
Expand Down

0 comments on commit fd9cad5

Please sign in to comment.