diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..5669b34 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,7 @@ +[build-system] +requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4.3"] +build-backend = "setuptools.build_meta" + +[tool.setuptools_scm] +write_to_template = "__version__ = \"{version}\"\n" +write_to = "parglare/version.py" diff --git a/setup.cfg b/setup.cfg index 5c31037..5e29ba2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -32,7 +32,7 @@ include_package_data = True package_dir = parglare = parglare test_suite = tests -setup_requires = setuptools_scm; +setup_requires = setuptools >= 42; wheel; setuptools_scm[toml] >= 3.4.3; [options.extras_require] diff --git a/setup.py b/setup.py index 8a45e87..f1e4113 100644 --- a/setup.py +++ b/setup.py @@ -7,13 +7,13 @@ this_dir = Path(__file__).absolute().parent if sys.argv[-1].startswith('publish'): - if os.system("pip list | grep wheel"): + if os.system("pip3 list | grep wheel"): print("wheel not installed.\nUse `pip install wheel`.\nExiting.") sys.exit() - if os.system("pip list | grep twine"): + if os.system("pip3 list | grep twine"): print("twine not installed.\nUse `pip install twine`.\nExiting.") sys.exit() - os.system("python setup.py sdist bdist_wheel") + os.system("python3 -m pep517 -bs .") if sys.argv[-1] == 'publishtest': os.system("twine upload -r test dist/*") else: @@ -21,7 +21,4 @@ sys.exit() if __name__ == "__main__": - setup(use_scm_version={ - "write_to": str(this_dir / "parglare" / "version.py"), - "write_to_template": '__version__ = "{version}"\n', - }) + setup()