Skip to content

Commit

Permalink
Update python packaging scripts (mamolinux#49)
Browse files Browse the repository at this point in the history
- Update setuptools version
- Add python dependencies
- Update dynamic versioning in
  setup.py
  • Loading branch information
hsbasu authored Mar 3, 2024
1 parent 4bfccb6 commit 82a5d80
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[build-system]
requires = ["setuptools>=42"]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
7 changes: 6 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,14 @@ classifiers =
[options]
package_dir =
= src
packages = find:
packages = find_namespace:
python_requires = >=3.6
include_package_data = True
install_requires =
configobj
PyGObject
setproctitle
tldextract

[options.package_data]
* = *VERSION
Expand Down
22 changes: 9 additions & 13 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,17 @@
import subprocess

from setuptools import setup
from subprocess import check_output

for line in check_output('dpkg-parsechangelog --format rfc822'.split(),
universal_newlines=True).splitlines():
header, colon, value = line.lower().partition(':')
if header == 'version':
version = value.strip()
break
else:
raise RuntimeError('No version found in debian/changelog')

with open("src/BatteryMonitor/VERSION", "w") as f:
if '~' in version:
version = version.split('~')[0]
f.write("%s" % version)
try:
version = (subprocess.check_output(["dpkg-parsechangelog",
"--show-field", "Version"])).decode().strip("\n")
except:
raise RuntimeError('No version found in debian/changelog')

if '~' in version:
version = version.split('~')[0]
f.write("%s" % version)

gschema_dir_suffix = 'share/glib-2.0/schemas'

Expand Down

0 comments on commit 82a5d80

Please sign in to comment.