-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try standardizing build requirements
- Loading branch information
1 parent
8a93604
commit 54eb854
Showing
9 changed files
with
60 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Submodule nipy
updated
7 files
+0 −3 | README.rst | |
+11 −51 | doc/devel/guidelines/make_release.rst | |
+5 −11 | nipy/__init__.py | |
+3 −167 | nipy/info.py | |
+72 −5 | pyproject.toml | |
+1 −1 | requirements.txt | |
+0 −34 | tools/refresh_readme.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/usr/bin/env python3 | ||
""" Echo dependencies for given environment | ||
""" | ||
|
||
from pathlib import Path | ||
from argparse import ArgumentParser, RawDescriptionHelpFormatter | ||
|
||
import tomlkit | ||
|
||
|
||
def get_build_requirements(repo_path): | ||
toml = (Path(repo_path) / 'pyproject.toml').read_text() | ||
config = tomlkit.loads(toml) | ||
requires = config.get('build-system', {}).get('requires', []) | ||
base_req = [R for R in requires if not 'numpy' in R] | ||
return ' '.join(base_req) | ||
|
||
|
||
def get_numpy_requirement(py_ver): | ||
major, minor, *_ = py_ver.split('.') | ||
assert major == "3" | ||
np_version = "1.22.2" | ||
minor = int(minor) | ||
if minor >= 12: | ||
np_version = "1.26.0" | ||
elif minor >= 11: | ||
np_version = "1.23.2" | ||
return np_version | ||
|
||
|
||
def get_parser(): | ||
parser = ArgumentParser(description=__doc__, # Usage from docstring | ||
formatter_class=RawDescriptionHelpFormatter) | ||
parser.add_argument("py_ver", help='Python version e.g. 3.11') | ||
parser.add_argument("repo_dir", help='Path to source repo') | ||
return parser | ||
|
||
|
||
def main(): | ||
parser = get_parser() | ||
args = parser.parse_args() | ||
np_req = get_numpy_requirement(args.py_ver) | ||
build_base = get_build_requirements(args.repo_dir) | ||
print(f'{build_base} numpy=={np_req}') | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |