-
Couldn't load subscription status.
- Fork 297
refactor setup.py to setup.cfg #4168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
98595e4
refactor setup.py to setup.cfg
bjlittle 2a09ea0
add keywords
bjlittle ad7b104
added a whatsnew entry
bjlittle 46bc28c
review actions
bjlittle 09efdfc
review actions
bjlittle a9c347b
rebase with review actions
bjlittle be5159b
review actions
bjlittle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,95 @@ | ||
| [metadata] | ||
| author = SciTools Developers | ||
| author_email = [email protected] | ||
trexfeathers marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| classifiers = | ||
| Development Status :: 5 Production/Stable | ||
| Intended Audience :: Science/Research | ||
| License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+) | ||
| Operating System :: MacOS | ||
| Operating System :: POSIX | ||
| Operating System :: POSIX :: Linux | ||
| Operating System :: Unix | ||
| Programming Language :: Python | ||
| Programming Language :: Python :: 3 :: Only | ||
| Programming Language :: Python :: 3.7 | ||
| Programming Language :: Python :: 3.8 | ||
| Programming Language :: Python :: Implementation :: CPython | ||
| Topic :: Scientific/Engineering | ||
| Topic :: Scientific/Engineering :: Atmospheric Science | ||
| Topic :: Scientific/Engineering :: Visualization | ||
| description = | ||
| A powerful, format-agnostic, community-driven Python package for analysing and visualising Earth science data | ||
| download_url = https://github.com/SciTools/iris | ||
| keywords = | ||
| cf-metadata | ||
| data-analysis | ||
| earth-science | ||
| grib | ||
| netcdf | ||
| meteorology | ||
| oceanography | ||
| space-weather | ||
| ugrid | ||
| visualisation | ||
| license = LGPL-3.0-or-later | ||
| license_file = COPYING.LESSER | ||
| long_description = file: README.md | ||
| long_description_content_type = text/markdown | ||
| name = scitools-iris | ||
| project_urls = | ||
| Code = https://github.com/SciTools/iris | ||
| Discussions = https://github.com/SciTools/iris/discussions | ||
| Documentation = https://scitools-iris.readthedocs.io/en/stable/ | ||
| Issues = https://github.com/SciTools/iris/issues | ||
| url = https://github.com/SciTools/iris | ||
| version = attr: iris.__version__ | ||
|
|
||
| [options] | ||
| include_package_data = True | ||
| install_requires = | ||
| cartopy>=0.18 | ||
| cf-units>=2 | ||
| cftime<1.3.0 | ||
| dask[array]>=2 | ||
| matplotlib | ||
| netcdf4 | ||
| numpy>=1.14 | ||
| scipy | ||
| scitools-pyke | ||
| xxhash | ||
| packages = find: | ||
| package_dir = | ||
| =lib | ||
| python_requires = | ||
| >=3.7 | ||
| zip_safe = False | ||
|
|
||
| [options.packages.find] | ||
| where = lib | ||
|
|
||
| [options.extras_require] | ||
| docs = | ||
| sphinx | ||
| sphinx-copybutton | ||
| sphinx-gallery | ||
| sphinx_rtd_theme | ||
| sphinxcontrib-napoleon | ||
| sphinx-panels | ||
| test = | ||
| asv | ||
| black==21.5b2 | ||
| filelock | ||
| flake8 | ||
| imagehash>=4.0 | ||
| nose | ||
| pillow<7 | ||
| pre-commit | ||
| requests | ||
| all = | ||
| mo_pack | ||
| nc-time-axis | ||
| pandas | ||
| pyugrid | ||
| stratify | ||
| %(docs)s | ||
| %(test)s | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| from contextlib import contextmanager | ||
| from distutils.util import convert_path | ||
| import os | ||
| from shutil import copyfile | ||
| import sys | ||
|
|
@@ -10,50 +9,6 @@ | |
| from setuptools.command.build_py import build_py | ||
|
|
||
|
|
||
| PACKAGE_DIR = os.path.abspath(os.path.dirname(__file__)) | ||
| PYPI_NAME = "scitools-iris" | ||
|
|
||
|
|
||
| # Returns the package and all its sub-packages | ||
| def find_package_tree(root_path, root_package): | ||
| root_path = root_path.replace("/", os.path.sep) | ||
| packages = [root_package] | ||
| root_count = len(root_path.split(os.path.sep)) | ||
| for (dir_path, dir_names, file_names) in os.walk(convert_path(root_path)): | ||
| # Prune dir_names *in-place* to prevent unwanted directory recursion | ||
| for dir_name in list(dir_names): | ||
| contains_init_file = os.path.isfile( | ||
| os.path.join(dir_path, dir_name, "__init__.py") | ||
| ) | ||
| if not contains_init_file: | ||
| dir_names.remove(dir_name) | ||
| # Exclude compiled PyKE rules, but keep associated unit tests. | ||
| if dir_name == "compiled_krb" and "tests" not in dir_path: | ||
| dir_names.remove(dir_name) | ||
| if dir_names: | ||
| prefix = dir_path.split(os.path.sep)[root_count:] | ||
| packages.extend( | ||
| [ | ||
| ".".join([root_package] + prefix + [dir_name]) | ||
| for dir_name in dir_names | ||
| ] | ||
| ) | ||
| return packages | ||
|
|
||
|
|
||
| def file_walk_relative(top, remove=""): | ||
| """ | ||
| Returns a generator of files from the top of the tree, removing | ||
| the given prefix from the root/file result. | ||
|
|
||
| """ | ||
| top = top.replace("/", os.path.sep) | ||
| remove = remove.replace("/", os.path.sep) | ||
| for root, dirs, files in os.walk(top): | ||
| for file in files: | ||
| yield os.path.join(root, file).replace(remove, "") | ||
|
|
||
|
|
||
| @contextmanager | ||
| def temporary_path(directory): | ||
| """ | ||
|
|
@@ -74,26 +29,6 @@ def temporary_path(directory): | |
| from _runner import TestRunner # noqa: | ||
|
|
||
|
|
||
| def pip_requirements(*args): | ||
| requirements = [] | ||
| for name in args: | ||
| fname = os.path.join( | ||
| PACKAGE_DIR, "requirements", "{}.txt".format(name) | ||
| ) | ||
| if not os.path.exists(fname): | ||
| emsg = ( | ||
| f"Unable to find the {name!r} requirements file at {fname!r}." | ||
| ) | ||
| raise RuntimeError(emsg) | ||
| with open(fname, "r") as fh: | ||
| for line in fh: | ||
| line = line.strip() | ||
| if not line or line.startswith("#"): | ||
| continue | ||
| requirements.append(line) | ||
| return requirements | ||
|
|
||
|
|
||
| class SetupTestRunner(TestRunner, Command): | ||
| pass | ||
|
|
||
|
|
@@ -217,25 +152,6 @@ def run(self): | |
| return ExtendedCommand | ||
|
|
||
|
|
||
| def extract_version(): | ||
| version = None | ||
| fname = os.path.join(PACKAGE_DIR, "lib", "iris", "__init__.py") | ||
| with open(fname) as fi: | ||
| for line in fi: | ||
| if line.startswith("__version__"): | ||
| _, version = line.split("=") | ||
| version = version.strip()[1:-1] # Remove quotations | ||
| break | ||
| return version | ||
|
|
||
|
|
||
| def long_description(): | ||
| fname = os.path.join(PACKAGE_DIR, "README.md") | ||
| with open(fname, "rb") as fi: | ||
| result = fi.read().decode("utf-8") | ||
| return result | ||
|
|
||
|
|
||
| custom_commands = { | ||
| "test": SetupTestRunner, | ||
| "develop": custom_cmd(develop_cmd, [build_std_names, compile_pyke_rules]), | ||
|
|
@@ -257,27 +173,5 @@ def long_description(): | |
|
|
||
|
|
||
| setup( | ||
| name=PYPI_NAME, | ||
| version=extract_version(), | ||
| url="http://scitools.org.uk/iris/", | ||
| author="UK Met Office", | ||
| author_email="[email protected]", | ||
| description="A powerful, format-agnostic, community-driven Python " | ||
| "package for analysing and visualising Earth science data", | ||
| long_description=long_description(), | ||
| long_description_content_type="text/markdown", | ||
| packages=find_package_tree("lib/iris", "iris"), | ||
| package_dir={"": "lib"}, | ||
| include_package_data=True, | ||
| cmdclass=custom_commands, | ||
| zip_safe=False, | ||
| setup_requires=pip_requirements("setup"), | ||
| install_requires=pip_requirements("setup", "core"), | ||
| tests_require=[f"{PYPI_NAME}[test]"], | ||
| extras_require={ | ||
| "all": pip_requirements("all"), | ||
| "docs": pip_requirements("docs"), | ||
| "test": pip_requirements("test"), | ||
| }, | ||
| python_requires=">=3.7", | ||
| ) | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.