From c1769d3c853620c1a52bb7da90a77035a8dc99d5 Mon Sep 17 00:00:00 2001 From: David Stansby Date: Fri, 2 Oct 2020 14:07:50 +0100 Subject: [PATCH 1/2] Use setup.cfg --- .readthedocs.yml | 3 ++- .travis.yml | 3 +-- requirements/base.txt | 5 ---- requirements/docs.txt | 13 ---------- requirements/test.txt | 6 ----- setup.cfg | 58 +++++++++++++++++++++++++++++++++++++++++++ setup.py | 21 ++-------------- test.py | 5 ++++ 8 files changed, 68 insertions(+), 46 deletions(-) delete mode 100644 requirements/base.txt delete mode 100644 requirements/docs.txt delete mode 100644 requirements/test.txt create mode 100644 test.py diff --git a/.readthedocs.yml b/.readthedocs.yml index 259b6c1d..7d2dcd58 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -5,6 +5,7 @@ formats: all python: version: 3.7 install: - - requirements: requirements/docs.txt - method: pip path: . + extra_requirements: + - docs diff --git a/.travis.yml b/.travis.yml index ac9951b0..e0a57cb2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,11 +24,10 @@ before_install: # Have to install numpy first to make streamtracer work - python -m pip install numpy -- python -m pip install -r requirements/test.txt - $EXTRAS install: -- python -m pip install -e . +- python -m pip install -e .[test] script: # Check that unit tests work diff --git a/requirements/base.txt b/requirements/base.txt deleted file mode 100644 index f067b14f..00000000 --- a/requirements/base.txt +++ /dev/null @@ -1,5 +0,0 @@ -matplotlib -numpy -scipy -astropy>=3 -sunpy!=2.0.2 diff --git a/requirements/docs.txt b/requirements/docs.txt deleted file mode 100644 index 20c76f64..00000000 --- a/requirements/docs.txt +++ /dev/null @@ -1,13 +0,0 @@ --r base.txt - -graphviz -pillow -reproject -sphinx-automodapi>=0.10 -sphinx_rtd_theme -sphinx-gallery -sphinx>2 -bs4 -drms -zeep -importlib_metadata diff --git a/requirements/test.txt b/requirements/test.txt deleted file mode 100644 index eba33301..00000000 --- a/requirements/test.txt +++ /dev/null @@ -1,6 +0,0 @@ --r base.txt - -pytest -pytest-cov -streamtracer -reproject diff --git a/setup.cfg b/setup.cfg index b86b618b..a77358fa 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,3 +1,61 @@ +[metadata] +name = pfsspy +provides = pfsspy +description = "Potential field source surface modelling" +long_description = file: README.md +long_description_content_type = text/markdown +author = David Stansby +author_email = dstansby@gmail.com +license = GPLv3 +license_file = LICENSE +url = https://pfsspy.readthedocs.io/en/stable/ +edit_on_github = True +github_project = dstansby/pfsspy +platform = any +keywords = solar physics, solar, science, sun +classifiers = + Development Status :: 4 - Beta + Intended Audience :: Science/Research + License :: OSI Approved :: GNU General Public License v3 (GPLv3) + Natural Language :: English + Operating System :: OS Independent + Programming Language :: Python + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Topic :: Scientific/Engineering :: Physics + +[options] +zip_safe = False +python_requires = >=3.6 +packages = pfsspy +include_package_data = True +install_requires = + astropy>=3 + matplotlib + numpy + scipy + sunpy + scikit-image + +[options.extras_require] +docs = + graphviz + pillow + reproject + sphinx-automodapi>=0.10 + sphinx_rtd_theme + sphinx-gallery + sphinx>2 + bs4 + drms + zeep + importlib_metadata +test = + pytest + pytest-cov + streamtracer + reproject # See the docstring in versioneer.py for instructions. Note that you must # re-run 'versioneer.py setup' after changing this section, and commit the diff --git a/setup.py b/setup.py index 17de3919..b999f9e0 100644 --- a/setup.py +++ b/setup.py @@ -5,22 +5,5 @@ if sys.version_info < (3, 5): sys.exit('Python versions older than 3.5 are not supported.') -setup(name='pfsspy', - version=versioneer.get_version(), - cmdclass=versioneer.get_cmdclass(), - description='Potential Field Source Surface model package', - author='David Stansby', - license='GPL3', - author_email='dstansby@gmail.com', - classifiers=['Development Status :: 4 - Beta', - 'Environment :: Console', - 'Intended Audience :: Science/Research', - 'Natural Language :: English', - 'Programming Language :: Python :: 3', - 'Topic :: Scientific/Engineering :: Physics'], - url='https://github.com/dstansby/pfsspy', - install_requires=['numpy', 'scipy', 'sunpy!=2.0.2', 'astropy>=3', - 'scikit-image'], - python_requires='>=3.5', - packages=['pfsspy'], - ) +setup(version=versioneer.get_version(), + cmdclass=versioneer.get_cmdclass()) diff --git a/test.py b/test.py new file mode 100644 index 00000000..a3df58c1 --- /dev/null +++ b/test.py @@ -0,0 +1,5 @@ +import sunpy.map +import pfsspy + +m = sunpy.map.Map('/Users/dstansby/sunpy/data/hmi.mrsynop_small_720s.2210.synopMr.fits') +print(m) From b786667a488e86f31b0dc70094f820361036bb9b Mon Sep 17 00:00:00 2001 From: David Stansby Date: Fri, 2 Oct 2020 14:13:18 +0100 Subject: [PATCH 2/2] Pin sunpy for docs --- setup.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.cfg b/setup.cfg index a77358fa..a4df3504 100644 --- a/setup.cfg +++ b/setup.cfg @@ -40,6 +40,7 @@ install_requires = [options.extras_require] docs = + sunpy!=2.0.2 graphviz pillow reproject