Skip to content

Commit 8296cbb

Browse files
committed
global: init autosemver
1 parent bff82bd commit 8296cbb

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

.github/workflows/build-and-release.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,14 @@ jobs:
1414
strategy:
1515
matrix:
1616
python-version: [2.7, 3.6]
17-
17+
1818
steps:
1919
- name: Checkout
2020
uses: actions/checkout@v2
2121
with:
2222
python-version: ${{ matrix.python-version }}
23-
fetch-depth: 0
2423

25-
- name: Set up Python 2.7
24+
- name: Set up Python ${{ matrix.python-version }}
2625
uses: actions/setup-python@v2
2726
with:
2827
python-version: ${{ matrix.python-version }}
@@ -32,16 +31,20 @@ jobs:
3231
python -m pip install --upgrade pip
3332
pip install setuptools twine wheel coveralls
3433
pip install -e .[all]
34+
3535
- name: Show python dependencies
3636
run: |
3737
pip freeze
38+
3839
- name: Run tests
3940
run: |
4041
./run-tests.sh
42+
4143
- name: Build package
4244
if: ${{ success() && github.event_name == 'push' && matrix.python-version == '3.6' }}
4345
run: |
4446
python setup.py sdist bdist_wheel
47+
4548
- name: Publish package
4649
if: ${{ success() && github.event_name == 'push' && matrix.python-version == '3.6' }}
4750
uses: pypa/[email protected]

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,5 @@ docs/_build/
6060

6161
# PyBuilder
6262
target/
63+
64+
.python-version

json_merger/version.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,6 @@
3030

3131
from __future__ import absolute_import, print_function
3232

33-
__version__ = "0.7.6"
33+
from autosemver.packaging import get_current_version
34+
35+
__version__ = get_current_version(project_name="json-merger")

setup.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,21 +66,19 @@
6666
install_requires = [
6767
'dictdiffer==0.8.1' if sys.version_info < (3, 6) else 'dictdiffer>=0.6.0',
6868
'six>=1.10.0',
69+
"autosemver==0.5.5",
6970
'pyrsistent>=0.11.13'
7071
]
7172

7273
packages = find_packages()
7374

74-
75-
# Get the version string. Cannot be done with import!
76-
g = {}
77-
with open(os.path.join('json_merger', 'version.py'), 'rt') as fp:
78-
exec(fp.read(), g)
79-
version = g['__version__']
75+
setup_require = [
76+
"autosemver==0.5.5"
77+
]
8078

8179
setup(
8280
name='json-merger',
83-
version=version,
81+
autosemver=True,
8482
description=__doc__,
8583
long_description=readme + '\n\n' + history,
8684
keywords='JSON patch merge conflict',
@@ -94,6 +92,7 @@
9492
platforms='any',
9593
entry_points={
9694
},
95+
setup_requires=setup_require,
9796
extras_require=extras_require,
9897
install_requires=install_requires,
9998
classifiers=[

0 commit comments

Comments
 (0)