diff --git a/README.md b/README.md index 672d7d75..720789bb 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ pip install remi For the most updated **experimental** version [Download](https://github.com/rawpython/remi/archive/master.zip) or check out Remi from git and install ``` -python setup.py install +pip install . ``` or install directly using pip diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..f169576f --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools>=40.8", "setuptools-scm"] +build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py index 263e7aee..e6ac7ed7 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,10 @@ params = { 'name':"remi", 'description':"Python REMote Interface library", - 'use_scm_version':{'version_scheme': 'post-release'}, + 'use_scm_version':{ + 'version_scheme': 'post-release', + 'fallback_version': '2026.03.24', + }, 'long_description':long_description, 'long_description_content_type':"text/markdown", 'url':"https://github.com/rawpython/remi", @@ -20,12 +23,5 @@ 'license':"Apache", 'packages':setuptools.find_packages(), 'include_package_data':True, - 'setup_requires':['setuptools_scm'], - 'version': '2026.03.24', } -try: - setup(**params) -except: - del params['setup_requires'] - params['use_scm_version'] = False - setup(**params) +setup(**params) diff --git a/test/test_version.py b/test/test_version.py index b91cf5b2..bc00e14c 100644 --- a/test/test_version.py +++ b/test/test_version.py @@ -98,15 +98,15 @@ def test_hardcoded_fallback_used(self): importlib.reload(remi) def test_fallback_version_matches_setup(self): - """_FALLBACK_VERSION in __init__.py must match the version in setup.py.""" + """_FALLBACK_VERSION in __init__.py must match fallback_version in setup.py.""" setup_py = os.path.join(os.path.dirname(__file__), '..', 'setup.py') setup_py = os.path.normpath(setup_py) with open(setup_py) as f: content = f.read() - # Extract the version string from setup.py: 'version': '...' + # Extract the fallback version string from setup.py. import re - match = re.search(r"'version'\s*:\s*'([^']+)'", content) - self.assertIsNotNone(match, "Could not find 'version' in setup.py") + match = re.search(r"'fallback_version'\s*:\s*'([^']+)'", content) + self.assertIsNotNone(match, "Could not find 'fallback_version' in setup.py") setup_version = match.group(1) self.assertEqual( remi._FALLBACK_VERSION,