Skip to content
Snippets Groups Projects

Merge of small MRs that make changes to the Python bindings

Merged Andreas Dedner requested to merge features/combinedPythonMRs into master
Compare and Show latest version
8 files
+ 57
54
Compare changes
  • Side-by-side
  • Inline
Files
8
+ 13
3
#!/usr/bin/env python3
import sys, os, io, getopt, re
import sys, os, io, getopt, re, shutil
import importlib, subprocess
import email.utils
import pkg_resources
@@ -96,8 +96,8 @@ def main(argv):
# Generate pyproject.toml
print("Generate pyproject.toml")
f = open("pyproject.toml", "w")
requires = ["setuptools", "wheel", "scikit-build", "cmake", "ninja", "requests", "portalocker", "numpy"]
requires += data.asPythonRequirementString(data.depends + data.python_requires)
requires = ["setuptools", "wheel", "scikit-build", "cmake", "ninja", "requests"]
requires += [r for r in data.asPythonRequirementString(data.depends + data.python_requires) if r not in requires]
f.write("[build-system]\n")
f.write("requires = "+requires.__str__()+"\n")
f.write("build-backend = 'setuptools.build_meta'\n")
@@ -117,6 +117,13 @@ def main(argv):
print("Please install the pip package 'scikit-build' to build the source distribution.")
sys.exit(2)
# append hash of current git commit to README
shutil.copy('README.md', 'tmp_README.md')
githash = ['git', 'rev-parse', 'HEAD']
hash = subprocess.check_output(githash, encoding='UTF-8')
with open("README.md", "a") as f:
f.write("\n\ngit-" + hash)
print("Create source distribution")
# make sure setup.py/pyproject.toml are tracked by git so that
# they get added to the package by scikit
@@ -129,6 +136,9 @@ def main(argv):
gitreset = ['git', 'reset', 'setup.py', 'pyproject.toml']
subprocess.call(gitreset)
# restore README.md
shutil.move('tmp_README.md', 'README.md')
if not onlysdist:
# check if we have twine
import pkg_resources
Loading