From 5962e9f85ffd1fc4ea2c4dac28d198d7ce017663 Mon Sep 17 00:00:00 2001 From: Martin Lang Date: Fri, 24 Jun 2022 14:59:37 +0200 Subject: [PATCH 1/9] Update repository metadata --- .pre-commit-config.yaml | 2 +- README.md | 2 +- pyproject.toml | 24 +++++++-------- setup.cfg | 34 --------------------- tasks.py | 68 +++++++++++++++++------------------------ 5 files changed, 41 insertions(+), 89 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c64abb4..343a790 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ default_language_version: repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v4.2.0 hooks: - id: check-merge-conflict # checks for files that contain merge conflict strings - id: check-toml # checks toml files for parseable syntax diff --git a/README.md b/README.md index 0b1621e..c47e48c 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ | Platforms | [![Platforms](https://anaconda.org/conda-forge/mag2exp/badges/platforms.svg)](https://anaconda.org/conda-forge/mag2exp) | | Downloads | [![Downloads](https://anaconda.org/conda-forge/mag2exp/badges/downloads.svg)](https://anaconda.org/conda-forge/mag2exp) | | License | [![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause) | -| DOI | [![DOI](https://zenodo.org/badge/67028400.svg)](https://zenodo.org/badge/latestdoi/67028400) | +| DOI | [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3539461.svg)](https://doi.org/10.5281/zenodo.3539461) | ## About diff --git a/pyproject.toml b/pyproject.toml index e3e3e84..b8e9ed9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,5 @@ [build-system] -# 40.8.0 is the first version compatible with PEP 517 -requires = ["setuptools>=40.8.0", "wheel"] +requires = ["setuptools"] build-backend = "setuptools.build_meta" [project] @@ -60,8 +59,17 @@ repository = "https://github.com/ubermag/mag2exp" +[tool.black] +experimental-string-processing = true + +[tool.coverage.run] +omit = ["mag2exp/tests/*"] + +[tool.isort] +profile = "black" +skip_gitignore = true # ignores files listed in .gitignore + # to define additional information we use a custom table -# we need to own the entry for tool.NAME on PyPI # see: https://www.python.org/dev/peps/pep-0518/#tool-table [tool.ubermag] doi = "10.5281/zenodo.3539461" @@ -73,13 +81,3 @@ about = """ - the ability to perform "virtual" experiments, - the functionality to compare of real experimental results agaist simulated experiments. """ - -[tool.coverage.run] -omit = ["mag2exp/tests/*"] - -[tool.isort] -profile = "black" -skip_gitignore = true # ignores files listed in .gitignore - -[tool.black] -experimental-string-processing = true diff --git a/setup.cfg b/setup.cfg index f9ddbd6..a21188f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,41 +1,7 @@ -[metadata] -name = mag2exp -version = 0.61.1 -description = Simulate experimental measurements for magnetic materials -author = Samuel Holt, James Loudon, Thomas Hicken, David Cortés Ortuño, Martin Lang, Marijan Beg, and Hans Fangohr -long_description = file: README.md -long_description_content_type = text/markdown -url = https://ubermag.github.io -licence = BSD 3-Clause License -classifiers = - Development Status :: 5 - Production/Stable - Intended Audience :: Education - Intended Audience :: Developers - Intended Audience :: Science/Research - License :: OSI Approved :: BSD License - Natural Language :: English - Operating System :: MacOS - Operating System :: Microsoft :: Windows - Operating System :: Unix - Programming Language :: Python :: 3 :: Only - Topic :: Scientific/Engineering :: Physics - Topic :: Scientific/Engineering :: Mathematics - Topic :: Scientific/Engineering :: Visualization - [options] packages = find: -python_requires >= 3.8 -install_requires = - oommfc>=0.62.0 - numpy>=1.19 - scipy>=1.6 include_package_data = True -[options.extras_require] -dev = build;invoke;nbval;pre-commit;pytest-cov;twine - - - [flake8] exclude = .git, diff --git a/tasks.py b/tasks.py index 36b6a2f..e8c22d9 100644 --- a/tasks.py +++ b/tasks.py @@ -7,18 +7,17 @@ import tomli from invoke import Collection, Exit, task -PYTHON = "python" +PYTHON = 'python' ns = Collection() -test_collection = Collection("test") +test_collection = Collection('test') @task def unittest(c): """Run unittests.""" import mag2exp - result = mag2exp.test() raise Exit(code=result) @@ -26,36 +25,30 @@ def unittest(c): @task def coverage(c): """Run unittests with coverage.""" - result = pytest.main(["-v", "--cov", "mag2exp", "--cov-report", "xml"]) + result = pytest.main(['-v', '--cov', 'mag2exp', + '--cov-report', 'xml']) raise Exit(code=result) @task def docs(c): """Run doctests.""" - result = pytest.main( - ["-v", "--doctest-modules", "--ignore", "mag2exp/tests", "mag2exp"] - ) + result = pytest.main(['-v', '--doctest-modules', '--ignore', + 'mag2exp/tests', 'mag2exp']) raise Exit(code=result) @task def ipynb(c): """Test notebooks.""" - result = pytest.main(["-v", "--nbval", "--sanitize-with", "nbval.cfg", "docs"]) + result = pytest.main(['-v', '--nbval', '--sanitize-with', 'nbval.cfg', + 'docs']) raise Exit(code=result) -@task +@task(unittest, docs, ipynb) def all(c): """Run all tests.""" - for cmd in (unittest, docs, ipynb): - try: - cmd(c) - except Exit as e: - if e.code != pytest.ExitCode.OK: - raise e - raise Exit(code=pytest.ExitCode.OK) test_collection.add_task(unittest) @@ -69,15 +62,15 @@ def all(c): @task def build_dists(c): """Build sdist and wheel.""" - if os.path.exists("dist"): - shutil.rmtree("dist") - c.run(f"{PYTHON} -m build") + if os.path.exists('dist'): + shutil.rmtree('dist') + c.run(f'{PYTHON} -m build') @task(build_dists) def upload(c): """Upload package to PyPI.""" - c.run("twine upload dist/*") + c.run('twine upload dist/*') @task @@ -92,36 +85,31 @@ def release(c): - Upload package to PyPI. - Push new tags. """ - c.run("git checkout master") - c.run("git pull") + c.run('git checkout master') + c.run('git pull') - res = c.run("git status -s", hide=True) - if res.stdout != "": - raise Exit("Working tree is not clean. Aborting.") + res = c.run('git status -s', hide=True) + if res.stdout != '': + raise Exit('Working tree is not clean. Aborting.') # run all tests - try: - all(c) - except Exit as e: - if e.code != pytest.ExitCode.OK: - raise e + all(c) - version = iniconfig.IniConfig("setup.cfg").get("metadata", "version") + version = iniconfig.IniConfig('setup.cfg').get('metadata', 'version') # sanity checks while we have two places containing the version. - with open("pyproject.toml", "rb") as f: - toml_version = tomli.load(f)["project"]["version"] - assert ( - toml_version == version - ), "Different versions in pyproject.toml and setup.cfg. Aborting." + with open('pyproject.toml', 'rb') as f: + toml_version = tomli.load(f)['project']['version'] + assert toml_version == version, ('Different versions in pyproject.toml and' + ' setup.cfg. Aborting.') - c.run(f"git tag {version}") # fails if the tag exists - c.run("git tag -f latest") # `latest` tag for binder + c.run(f'git tag {version}') # fails if the tag exists + c.run('git tag -f latest') # `latest` tag for binder build_dists(c) upload(c) - c.run("git push -f --tags") - c.run("git push") + c.run('git push -f --tags') + c.run('git push') ns.add_task(build_dists) From 798d0882f139e58caaf3e1b5b150743d9d8707b8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 24 Jun 2022 13:03:15 +0000 Subject: [PATCH 2/9] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tasks.py | 53 +++++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/tasks.py b/tasks.py index e8c22d9..e4b93dc 100644 --- a/tasks.py +++ b/tasks.py @@ -7,17 +7,18 @@ import tomli from invoke import Collection, Exit, task -PYTHON = 'python' +PYTHON = "python" ns = Collection() -test_collection = Collection('test') +test_collection = Collection("test") @task def unittest(c): """Run unittests.""" import mag2exp + result = mag2exp.test() raise Exit(code=result) @@ -25,24 +26,23 @@ def unittest(c): @task def coverage(c): """Run unittests with coverage.""" - result = pytest.main(['-v', '--cov', 'mag2exp', - '--cov-report', 'xml']) + result = pytest.main(["-v", "--cov", "mag2exp", "--cov-report", "xml"]) raise Exit(code=result) @task def docs(c): """Run doctests.""" - result = pytest.main(['-v', '--doctest-modules', '--ignore', - 'mag2exp/tests', 'mag2exp']) + result = pytest.main( + ["-v", "--doctest-modules", "--ignore", "mag2exp/tests", "mag2exp"] + ) raise Exit(code=result) @task def ipynb(c): """Test notebooks.""" - result = pytest.main(['-v', '--nbval', '--sanitize-with', 'nbval.cfg', - 'docs']) + result = pytest.main(["-v", "--nbval", "--sanitize-with", "nbval.cfg", "docs"]) raise Exit(code=result) @@ -62,15 +62,15 @@ def all(c): @task def build_dists(c): """Build sdist and wheel.""" - if os.path.exists('dist'): - shutil.rmtree('dist') - c.run(f'{PYTHON} -m build') + if os.path.exists("dist"): + shutil.rmtree("dist") + c.run(f"{PYTHON} -m build") @task(build_dists) def upload(c): """Upload package to PyPI.""" - c.run('twine upload dist/*') + c.run("twine upload dist/*") @task @@ -85,31 +85,32 @@ def release(c): - Upload package to PyPI. - Push new tags. """ - c.run('git checkout master') - c.run('git pull') + c.run("git checkout master") + c.run("git pull") - res = c.run('git status -s', hide=True) - if res.stdout != '': - raise Exit('Working tree is not clean. Aborting.') + res = c.run("git status -s", hide=True) + if res.stdout != "": + raise Exit("Working tree is not clean. Aborting.") # run all tests all(c) - version = iniconfig.IniConfig('setup.cfg').get('metadata', 'version') + version = iniconfig.IniConfig("setup.cfg").get("metadata", "version") # sanity checks while we have two places containing the version. - with open('pyproject.toml', 'rb') as f: - toml_version = tomli.load(f)['project']['version'] - assert toml_version == version, ('Different versions in pyproject.toml and' - ' setup.cfg. Aborting.') + with open("pyproject.toml", "rb") as f: + toml_version = tomli.load(f)["project"]["version"] + assert ( + toml_version == version + ), "Different versions in pyproject.toml and setup.cfg. Aborting." - c.run(f'git tag {version}') # fails if the tag exists - c.run('git tag -f latest') # `latest` tag for binder + c.run(f"git tag {version}") # fails if the tag exists + c.run("git tag -f latest") # `latest` tag for binder build_dists(c) upload(c) - c.run('git push -f --tags') - c.run('git push') + c.run("git push -f --tags") + c.run("git push") ns.add_task(build_dists) From 966e154dd6e35be8ed1195105b0d18c513e9e341 Mon Sep 17 00:00:00 2001 From: Martin Lang Date: Fri, 24 Jun 2022 15:10:29 +0200 Subject: [PATCH 3/9] Update authors --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b8e9ed9..a6d65d8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,10 +12,11 @@ license = {file = "LICENSE"} authors = [ {name = "Samuel Holt"}, + {name = "Martin Lang"}, {name = "James Loudon"}, {name = "Thomas Hicken"}, + {name = "Swapneel Amit Pathak"}, {name = "David Cortés Ortuño"}, - {name = "Martin Lang"}, {name = "Marijan Beg"}, {name = "Hans Fangohr"} ] From a4df88f2161144ad4ef53b564d33b2f4a580ae82 Mon Sep 17 00:00:00 2001 From: Martin Lang Date: Fri, 24 Jun 2022 15:17:42 +0200 Subject: [PATCH 4/9] Update repository metadata --- .pre-commit-config.yaml | 2 +- README.md | 10 +++++----- tasks.py | 36 +++++++++++++++++++++++------------- 3 files changed, 29 insertions(+), 19 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 343a790..c64abb4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ default_language_version: repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.2.0 + rev: v4.3.0 hooks: - id: check-merge-conflict # checks for files that contain merge conflict strings - id: check-toml # checks toml files for parseable syntax diff --git a/README.md b/README.md index c47e48c..4be8c62 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@ # mag2exp -[Samuel Holt](https://github.com/samjrholt)1,2, James Loudon3, Thomas Hicken4, [David Cortés Ortuño](https://github.com/davidcortesortuno)5, [Martin Lang](https://github.com/lang-m)1, [Marijan Beg](https://github.com/marijanbeg)6,1, and [Hans Fangohr](https://github.com/fangohr)1,7,8 +[Samuel Holt](https://github.com/samjrholt)1,2, [Martin Lang](https://github.com/lang-m)1, James Loudon3, Thomas Hicken4, [Swapneel Amit Pathak](https://github.com/swapneelap)1,5, [David Cortés Ortuño](https://github.com/davidcortesortuno)6, [Marijan Beg](https://github.com/marijanbeg)7,1, and [Hans Fangohr](https://github.com/fangohr)1,5,8 1 *Faculty of Engineering and Physical Sciences, University of Southampton, Southampton SO17 1BJ, UK* 2 *Department of Physics, University of Warwick, Coventry CV4 7AL, UK* 3 *Department of Materials Science and Metallurgy, University of Cambridge, Cambridge, CB3 0FS, United Kingdom* 4 *Department of Physics, Durham University, Durham, DH1 3LE, United Kingdom* -5 *Paleomagnetic Laboratory Fort Hoofddijk, Utrecht University, Utrecht, 3584 CD, Netherlands* -6 *Department of Earth Science and Engineering, Imperial College London, London SW7 2AZ, UK* -7 *Max Planck Institute for the Structure and Dynamics of Matter, Luruper Chaussee 149, 22761 Hamburg, Germany* +5 *Max Planck Institute for the Structure and Dynamics of Matter, Luruper Chaussee 149, 22761 Hamburg, Germany* +6 *Paleomagnetic Laboratory Fort Hoofddijk, Utrecht University, Utrecht, 3584 CD, Netherlands* +7 *Department of Earth Science and Engineering, Imperial College London, London SW7 2AZ, UK* 8 *Center for Free-Electron Laser Science, Luruper Chaussee 149, 22761 Hamburg, Germany* @@ -77,7 +77,7 @@ Licensed under the BSD 3-Clause "New" or "Revised" License. For details, please 2. M. Beg, R. A. Pepper, and H. Fangohr. User interfaces for computational science: A domain specific language for OOMMF embedded in Python. [*AIP Advances* **7**, 56025](http://aip.scitation.org/doi/10.1063/1.4977225) (2017). -3. Samuel Holt, James Loudon, Thomas Hicken, David Cortés Ortuño, Martin Lang, Marijan Beg, and Hans Fangohr. mag2exp: Simulate experimental measurements for magnetic materials DOI: [10.5281/zenodo.3539461](http://doi.org/10.5281/zenodo.3539461) (2022). +3. Samuel Holt, Martin Lang, James Loudon, Thomas Hicken, Swapneel Amit Pathak, David Cortés Ortuño, Marijan Beg, and Hans Fangohr. mag2exp: Simulate experimental measurements for magnetic materials DOI: [10.5281/zenodo.3539461](http://doi.org/10.5281/zenodo.3539461) (2022). ## Acknowledgements diff --git a/tasks.py b/tasks.py index e4b93dc..491bb8c 100644 --- a/tasks.py +++ b/tasks.py @@ -7,18 +7,17 @@ import tomli from invoke import Collection, Exit, task -PYTHON = "python" +PYTHON = 'python' ns = Collection() -test_collection = Collection("test") +test_collection = Collection('test') @task def unittest(c): """Run unittests.""" import mag2exp - result = mag2exp.test() raise Exit(code=result) @@ -26,29 +25,37 @@ def unittest(c): @task def coverage(c): """Run unittests with coverage.""" - result = pytest.main(["-v", "--cov", "mag2exp", "--cov-report", "xml"]) + result = pytest.main(["-v", "--cov", "mag2exp", + "--cov-report", "xml"]) raise Exit(code=result) @task def docs(c): """Run doctests.""" - result = pytest.main( - ["-v", "--doctest-modules", "--ignore", "mag2exp/tests", "mag2exp"] - ) + result = pytest.main(["-v", "--doctest-modules", "--ignore", + "mag2exp/tests", "mag2exp"]) raise Exit(code=result) @task def ipynb(c): """Test notebooks.""" - result = pytest.main(["-v", "--nbval", "--sanitize-with", "nbval.cfg", "docs"]) + result = pytest.main(["-v", "--nbval", "--sanitize-with", "nbval.cfg", + "docs"]) raise Exit(code=result) -@task(unittest, docs, ipynb) +@task def all(c): """Run all tests.""" + for cmd in (unittest, docs, ipynb): + try: + cmd(c) + except Exit as e: + if e.code != pytest.ExitCode.OK: + raise e + raise Exit(code=pytest.ExitCode.OK) test_collection.add_task(unittest) @@ -93,15 +100,18 @@ def release(c): raise Exit("Working tree is not clean. Aborting.") # run all tests - all(c) + try: + all(c) + except Exit as e: + if e.code != pytest.ExitCode.OK: + raise e version = iniconfig.IniConfig("setup.cfg").get("metadata", "version") # sanity checks while we have two places containing the version. with open("pyproject.toml", "rb") as f: toml_version = tomli.load(f)["project"]["version"] - assert ( - toml_version == version - ), "Different versions in pyproject.toml and setup.cfg. Aborting." + assert toml_version == version, ("Different versions in pyproject.toml and" + " setup.cfg. Aborting.") c.run(f"git tag {version}") # fails if the tag exists c.run("git tag -f latest") # `latest` tag for binder From c1bfddacf492eb80705cc8154db0121413c6d650 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 24 Jun 2022 13:20:53 +0000 Subject: [PATCH 5/9] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tasks.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/tasks.py b/tasks.py index 491bb8c..36b6a2f 100644 --- a/tasks.py +++ b/tasks.py @@ -7,17 +7,18 @@ import tomli from invoke import Collection, Exit, task -PYTHON = 'python' +PYTHON = "python" ns = Collection() -test_collection = Collection('test') +test_collection = Collection("test") @task def unittest(c): """Run unittests.""" import mag2exp + result = mag2exp.test() raise Exit(code=result) @@ -25,24 +26,23 @@ def unittest(c): @task def coverage(c): """Run unittests with coverage.""" - result = pytest.main(["-v", "--cov", "mag2exp", - "--cov-report", "xml"]) + result = pytest.main(["-v", "--cov", "mag2exp", "--cov-report", "xml"]) raise Exit(code=result) @task def docs(c): """Run doctests.""" - result = pytest.main(["-v", "--doctest-modules", "--ignore", - "mag2exp/tests", "mag2exp"]) + result = pytest.main( + ["-v", "--doctest-modules", "--ignore", "mag2exp/tests", "mag2exp"] + ) raise Exit(code=result) @task def ipynb(c): """Test notebooks.""" - result = pytest.main(["-v", "--nbval", "--sanitize-with", "nbval.cfg", - "docs"]) + result = pytest.main(["-v", "--nbval", "--sanitize-with", "nbval.cfg", "docs"]) raise Exit(code=result) @@ -110,8 +110,9 @@ def release(c): # sanity checks while we have two places containing the version. with open("pyproject.toml", "rb") as f: toml_version = tomli.load(f)["project"]["version"] - assert toml_version == version, ("Different versions in pyproject.toml and" - " setup.cfg. Aborting.") + assert ( + toml_version == version + ), "Different versions in pyproject.toml and setup.cfg. Aborting." c.run(f"git tag {version}") # fails if the tag exists c.run("git tag -f latest") # `latest` tag for binder From 64a5f6769748b9a84021ab4fcdbd78e04134866a Mon Sep 17 00:00:00 2001 From: Martin Lang Date: Fri, 24 Jun 2022 15:22:10 +0200 Subject: [PATCH 6/9] Update repository metadata --- tasks.py | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/tasks.py b/tasks.py index 36b6a2f..c0f56f6 100644 --- a/tasks.py +++ b/tasks.py @@ -2,7 +2,6 @@ import os import shutil -import iniconfig import pytest import tomli from invoke import Collection, Exit, task @@ -26,23 +25,24 @@ def unittest(c): @task def coverage(c): """Run unittests with coverage.""" - result = pytest.main(["-v", "--cov", "mag2exp", "--cov-report", "xml"]) + result = pytest.main(["-v", "--cov", "mag2exp", + "--cov-report", "xml"]) raise Exit(code=result) @task def docs(c): """Run doctests.""" - result = pytest.main( - ["-v", "--doctest-modules", "--ignore", "mag2exp/tests", "mag2exp"] - ) + result = pytest.main(["-v", "--doctest-modules", "--ignore", + "mag2exp/tests", "mag2exp"]) raise Exit(code=result) @task def ipynb(c): """Test notebooks.""" - result = pytest.main(["-v", "--nbval", "--sanitize-with", "nbval.cfg", "docs"]) + result = pytest.main(["-v", "--nbval", "--sanitize-with", "nbval.cfg", + "docs"]) raise Exit(code=result) @@ -106,13 +106,8 @@ def release(c): if e.code != pytest.ExitCode.OK: raise e - version = iniconfig.IniConfig("setup.cfg").get("metadata", "version") - # sanity checks while we have two places containing the version. with open("pyproject.toml", "rb") as f: - toml_version = tomli.load(f)["project"]["version"] - assert ( - toml_version == version - ), "Different versions in pyproject.toml and setup.cfg. Aborting." + version = tomli.load(f)["project"]["version"] c.run(f"git tag {version}") # fails if the tag exists c.run("git tag -f latest") # `latest` tag for binder From ab738dfa9750ca1dfb35909a729e75a051f203cc Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 24 Jun 2022 13:24:03 +0000 Subject: [PATCH 7/9] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tasks.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tasks.py b/tasks.py index c0f56f6..f7e575d 100644 --- a/tasks.py +++ b/tasks.py @@ -25,24 +25,23 @@ def unittest(c): @task def coverage(c): """Run unittests with coverage.""" - result = pytest.main(["-v", "--cov", "mag2exp", - "--cov-report", "xml"]) + result = pytest.main(["-v", "--cov", "mag2exp", "--cov-report", "xml"]) raise Exit(code=result) @task def docs(c): """Run doctests.""" - result = pytest.main(["-v", "--doctest-modules", "--ignore", - "mag2exp/tests", "mag2exp"]) + result = pytest.main( + ["-v", "--doctest-modules", "--ignore", "mag2exp/tests", "mag2exp"] + ) raise Exit(code=result) @task def ipynb(c): """Test notebooks.""" - result = pytest.main(["-v", "--nbval", "--sanitize-with", "nbval.cfg", - "docs"]) + result = pytest.main(["-v", "--nbval", "--sanitize-with", "nbval.cfg", "docs"]) raise Exit(code=result) From 633a42ffe5cd48309fcf1189d3916ec3e3323fd9 Mon Sep 17 00:00:00 2001 From: Martin Lang Date: Fri, 24 Jun 2022 15:30:32 +0200 Subject: [PATCH 8/9] Remove make.bat --- make.bat | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 make.bat diff --git a/make.bat b/make.bat deleted file mode 100644 index b1a59e9..0000000 --- a/make.bat +++ /dev/null @@ -1,23 +0,0 @@ -@ECHO OFF - -set PROJECT=mag2exp -set IPYNBPATH=docs/ipynb/*.ipynb -set PYTHON=python - -REM Command file for testing - - -%PYTHON% -c "import sys; import %PROJECT%; sys.exit(%PROJECT%.test())" - -REM test-coverage: -%PYTHON% -m pytest -v --cov=%PROJECT% --cov-report=xml --cov-config .coveragerc - -REM test-docs: -%PYTHON% -m pytest -v --doctest-modules --ignore=%PROJECT%/tests %PROJECT% - -REM test-ipynb: -%PYTHON% -m pytest -v --nbval %IPYNBPATH% - -%PYTHON% -m pycodestyle --filename=*.py . - - From 4da48a8275a9617a1b83ab8011962c7f0a58ba04 Mon Sep 17 00:00:00 2001 From: Martin Lang Date: Fri, 24 Jun 2022 15:33:13 +0200 Subject: [PATCH 9/9] Remove old Makefile --- Makefile | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 Makefile diff --git a/Makefile b/Makefile deleted file mode 100644 index 405e8d0..0000000 --- a/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -PROJECT=mag2exp -IPYNBPATH=docs/*.ipynb -PYTHON?=python - -test-unittests: - $(PYTHON) -c "import sys; import $(PROJECT); sys.exit($(PROJECT).test())" - -test-coverage: - $(PYTHON) -m pytest -v --cov=$(PROJECT) --cov-report=xml - -test-docs: - $(PYTHON) -m pytest -v --doctest-modules --ignore=$(PROJECT)/tests $(PROJECT) - -test-ipynb: - $(PYTHON) -m pytest -v --nbval --sanitize-with nbval.cfg $(IPYNBPATH) - -test-pycodestyle: - $(PYTHON) -m pycodestyle --filename=*.py . - -test-all: test-unittests test-docs test-ipynb test-pycodestyle - -build-dists: - rm -rf dist/ - $(PYTHON) setup.py sdist bdist_wheel - -release: build-dists - twine upload dist/*