Skip to content

Commit 61c37b2

Browse files
author
James Reynolds
committed
Changed version stuff, packaging stuff, trying to get github action to work
1 parent 9683c35 commit 61c37b2

File tree

5 files changed

+19
-14
lines changed

5 files changed

+19
-14
lines changed

.github/workflows/python-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
with:
3838
python-version: 3.7
3939
- name: Build binary wheel and a source tarball
40-
run: python setup.py sdist
40+
run: python setup.py sdist bdist_wheel
4141
- name: Publish to PyPI
4242
uses: pypa/gh-action-pypi-publish@master
4343
with:

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include jamf/records.json
2+
include jamf/VERSION

jamf/setconfig.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,10 @@ def parse(self, argv):
7171
return self.parser.parse_args(argv)
7272

7373
def check_version():
74-
if not jamf.version.check_version(min_jamf_version):
75-
print(f"setconfig requires python-jamf {min_jamf_version} or newer.")
74+
python_jamf_version = jamf.version.jamf_version_up_to(min_jamf_version)
75+
if python_jamf_version != min_jamf_version:
76+
print(f"setconfig requires python-jamf {min_jamf_version} or newer. "
77+
f"You have {python_jamf_version}.")
7678
sys.exit()
7779

7880
def setconfig(argv):

jamf/version.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
__all__ = (
1010
'string',
11-
'check_version'
11+
'jamf_version_up_to'
1212
)
1313

1414
def string():
@@ -19,17 +19,18 @@ def string():
1919
return version
2020
except:
2121
pass
22-
return "unknown (git checkout)"
22+
return "0.0.0"
2323

2424

25-
def check_version(min_version):
25+
def jamf_version_up_to(min_version):
26+
current_version = string()
2627
try:
27-
jamf_1, jamf_2, jamf_3 = string().split(".")
28+
jamf_1, jamf_2, jamf_3 = current_version.split(".")
2829
min_1, min_2, min_3 = min_version.split(".")
2930
if ( int(jamf_1) <= int(min_1) and
3031
int(jamf_2) <= int(min_2) and
3132
int(jamf_3) < int(min_3)):
32-
return False
33+
return current_version
3334
except AttributeError:
34-
return False
35-
return True
35+
return current_version
36+
return min_version

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22
import subprocess
33
import os
44

5-
jctl_version = (
5+
jamf_version = (
66
subprocess.run(["git", "describe", "--tags"], stdout=subprocess.PIPE)
77
.stdout.decode("utf-8")
88
.strip()
99
)
10-
#assert "." in jctl_version
10+
#assert "." in jamf_version
1111

1212
assert os.path.isfile("jamf/version.py")
1313
with open("jamf/VERSION", "w", encoding="utf-8") as fh:
14-
fh.write(f"{jctl_version}\n")
14+
fh.write(f"{jamf_version}\n")
1515

1616
with open("README.md", "r", encoding="utf-8") as fh:
1717
long_description = fh.read()
1818

1919
setuptools.setup(
2020
name="python-jamf",
21-
version=jctl_version,
21+
version=jamf_version,
2222
author="The University of Utah",
2323
author_email="[email protected]",
2424
description="Python wrapper for Jamf Pro API",

0 commit comments

Comments
 (0)