diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 2acbc5ae..00000000 --- a/.coveragerc +++ /dev/null @@ -1,8 +0,0 @@ -[run] -source = metcalcpy -relative_files = True -omit = - config.py - config-3.py - metcalcpy/contributed/* - diff --git a/README.md b/README.md index 36d28fca..cea21286 100644 --- a/README.md +++ b/README.md @@ -15,10 +15,10 @@ For information about the support provided for releases, see our [Release Suppor Instructions for installing the metcalcpy package locally --------------------------------------------------------- - activate your conda environment (i.e. 'conda activate your-conda-env-name') -- from within your active conda environment, cd to the METcalcpy/ directory, where you will see the setup.py script +- from within your active conda environment, cd to the METcalcpy/ directory, where you will see the file pyproject.toml - from this directory, run the following on the command line: pip install -e . - the -e option stands for editable, which is useful in that you can update your METcalcpy/metcalcpy source without reinstalling it -- the . indicates that you should search the current directory for the setup.py script +- the . indicates that you should search the current directory for the pyproject.toml file. - use metcalcpy package via import statement: - Examples: diff --git a/docs/Users_Guide/installation.rst b/docs/Users_Guide/installation.rst index 17bf80e3..6b96a17f 100644 --- a/docs/Users_Guide/installation.rst +++ b/docs/Users_Guide/installation.rst @@ -39,7 +39,7 @@ METcalcpy source code, e.g. `/User/someuser/METcalcpy`. From this directory, ru `pip install -e .` -This instructs pip to install the package based on instructios in the setup.py file located in the current directory +This instructs pip to install the package based on instructios in the pyproject.toml file located in the current directory (as indicated by the '.'). The `-e` directs pip to install the package in edit mode, so if one wishes to make changes to this source code, the changes are automatically applied without the need to re-install the package. diff --git a/docs/version b/docs/version index 5c8498d0..f0c3e423 100644 --- a/docs/version +++ b/docs/version @@ -1 +1 @@ -__version__="3.0.0-dev" +3.0.0-rc1-dev diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..82cf4242 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,62 @@ +[build-system] +requires = [ + "setuptools", + "wheel", + "setuptools-git-versioning>=2.0,<3", +] +build-backend = "setuptools.build_meta" + +[project] +name = "metcalcpy" +dynamic = ["version", "dependencies"] +description = "statistics and util package for METplus" +authors = [ + {name = "METplus"}, +] +requires-python = ">=3.10.4" +readme = "README.md" +license = {text = "MIT"} +classifiers = [ + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", +] + +[project.urls] +Homepage = "https://github.com/dtcenter/METcalcpy" + +[tool.setuptools.packages] +find = {include = ["metcalcpy*"]} + +[tool.setuptools.package-data] +metplus = [ + "docs/version" +] + +[tool.setuptools.exclude-package-data] +metplus = ["README", "__pycache__", "*~"] + +[tool.setuptools.dynamic] +dependencies = {file = ["requirements.txt"]} + +[tool.setuptools-git-versioning] +enabled = true +version_file = "docs/version" + +[tool.pytest.ini_options] +testpaths = ["test"] + +[tool.coverage.run] +source = ["metcalcpy"] +omit = [ + "config.py", + "config-3.py", + "metcalcpy/contributed/*", + ] +relative_files = true + +[tool.coverage.report] +exclude_also = [ + "def __repr__", + "if __name__ == .__main__.:", + ] \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 2c06f5f8..00000000 --- a/setup.py +++ /dev/null @@ -1,29 +0,0 @@ -import setuptools -from setuptools import setup, find_packages -from distutils.util import convert_path - -with open("README.md", "r") as fh: - long_description = fh.read() - -main_ns = {} -version_path = convert_path('docs/version') -with open(version_path) as version_file: - exec(version_file.read(), main_ns) - -setuptools.setup( - name="metcalcpy", - version=main_ns['__version__'], - author="METplus", - author_email="met-help@ucar.edu", - description="statistics and util package for METplus", - long_description=long_description, - long_description_content_type="text/markdown", - url="https://github.com/dtcenter/METcalcpy", - packages=setuptools.find_packages(), - classifiers=[ - "Programming Language :: Python :: 3", - "License :: OSI Approved :: Apache Software License", - "Operating System :: OS Independent", - ], - python_requires='>=3.6', -)