From 07a444dcb52816a00425b06b08d2861cf4e212bd Mon Sep 17 00:00:00 2001 From: Pingu Carsti Date: Thu, 30 Nov 2023 15:29:00 +0100 Subject: [PATCH 01/14] updated by cruft --- .cruft.json | 71 +++++++++++----------- .gitignore | 16 +++++ CONTRIBUTING.rst | 128 ++++++++++++++++++++++++++++++++++++++++ LICENSE.txt => LICENSE | 18 +++++- MANIFEST.in | 1 + README.rst | 5 +- docs/source/.gitignore | 3 - docs/source/authors.rst | 1 + docs/source/conf.py | 5 +- docs/source/index.rst | 1 + emu/__version__.py | 6 +- emu/cli.py | 6 +- requirements_dev.txt | 9 ++- setup.cfg | 18 ++++-- setup.py | 1 - tests/__init__.py | 2 - tests/test_emu.py | 26 ++++++++ tox.ini | 29 +++++++++ 18 files changed, 290 insertions(+), 56 deletions(-) create mode 100644 CONTRIBUTING.rst rename LICENSE.txt => LICENSE (94%) delete mode 100644 docs/source/.gitignore create mode 100644 docs/source/authors.rst create mode 100644 tests/test_emu.py create mode 100644 tox.ini diff --git a/.cruft.json b/.cruft.json index 102589b..195a63e 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,36 +1,39 @@ { - "template": "https://github.com/bird-house/cookiecutter-birdhouse.git", - "commit": "f157ea8419fd4e32a9e4d52e613c90c807190e7e", - "skip": [ - "emu/processes/wps_say_hello.py", - "tests/test_wps_hello.py", - "docs/source/notebooks/example.ipynb", - "environment.yml", - "requirements.txt", - "AUTHORS.rst", - "CHANGES.rst", - "docs/source/notebooks/index.rst", - "docs/source/processes.rst", - "emu/processes/__init__.py", - "tests/test_wps_caps.py" - ], - "context": { - "cookiecutter": { - "full_name": "Carsten Ehbrecht", - "email": "ehbrecht@dkrz.de", - "github_username": "bird-house", - "project_name": "Emu", - "project_slug": "emu", - "project_repo_name": "emu", - "project_readthedocs_name": "emu", - "project_short_description": "WPS processes for testing and demos.", - "version": "0.12.0", - "open_source_license": "Apache Software License 2.0", - "http_port": "5000", - "_copy_without_render": [ - "{{cookiecutter.project_slug}}/templates/*.cfg" - ], - "_template": "https://github.com/bird-house/cookiecutter-birdhouse.git" - } + "template": "https://github.com/bird-house/cookiecutter-birdhouse.git", + "commit": "bc8a389e02a3e55e55dad7657671d91e2f238ed9", + "skip": [ + "emu/processes/wps_say_hello.py", + "tests/test_wps_hello.py", + "docs/source/notebooks/example.ipynb", + "environment.yml", + "requirements.txt", + "AUTHORS.rst", + "CHANGES.rst", + "docs/source/notebooks/index.rst", + "docs/source/processes.rst", + "emu/processes/__init__.py", + "tests/test_wps_caps.py" + ], + "context": { + "cookiecutter": { + "full_name": "Carsten Ehbrecht", + "email": "ehbrecht@dkrz.de", + "github_username": "bird-house", + "project_name": "Emu", + "project_slug": "emu", + "project_repo_name": "emu", + "project_readthedocs_name": "emu", + "project_short_description": "WPS processes for testing and demos.", + "version": "0.12.0", + "open_source_license": "Apache Software License 2.0", + "http_port": "5000", + "use_pytest": "y", + "create_author_file": "y", + "_copy_without_render": [ + "{{cookiecutter.project_slug}}/templates/*.cfg" + ], + "_template": "https://github.com/bird-house/cookiecutter-birdhouse.git" } -} \ No newline at end of file + }, + "checkout": null +} diff --git a/.gitignore b/.gitignore index 571ef18..c9c2581 100644 --- a/.gitignore +++ b/.gitignore @@ -91,3 +91,19 @@ testdata.json # Merge conflict *.orig + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ + +# IDE settings +.vscode/ diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst new file mode 100644 index 0000000..406e43c --- /dev/null +++ b/CONTRIBUTING.rst @@ -0,0 +1,128 @@ +.. highlight:: shell + +============ +Contributing +============ + +Contributions are welcome, and they are greatly appreciated! Every little bit +helps, and credit will always be given. + +You can contribute in many ways: + +Types of Contributions +---------------------- + +Report Bugs +~~~~~~~~~~~ + +Report bugs at https://github.com/bird-house/emu/issues. + +If you are reporting a bug, please include: + +* Your operating system name and version. +* Any details about your local setup that might be helpful in troubleshooting. +* Detailed steps to reproduce the bug. + +Fix Bugs +~~~~~~~~ + +Look through the GitHub issues for bugs. Anything tagged with "bug" and "help +wanted" is open to whoever wants to implement it. + +Implement Features +~~~~~~~~~~~~~~~~~~ + +Look through the GitHub issues for features. Anything tagged with "enhancement" +and "help wanted" is open to whoever wants to implement it. + +Write Documentation +~~~~~~~~~~~~~~~~~~~ + +Emu could always use more documentation, whether as part of the +official Emu docs, in docstrings, or even on the web in blog posts, +articles, and such. + +Submit Feedback +~~~~~~~~~~~~~~~ + +The best way to send feedback is to file an issue at https://github.com/bird-house/emu/issues. + +If you are proposing a feature: + +* Explain in detail how it would work. +* Keep the scope as narrow as possible, to make it easier to implement. +* Remember that this is a volunteer-driven project, and that contributions + are welcome :) + +Get Started! +------------ + +Ready to contribute? Here's how to set up `emu` for local development. + +1. Fork the `emu` repo on GitHub. +2. Clone your fork locally:: + + $ git clone git@github.com:your_name_here/emu.git + +3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development:: + + $ mkvirtualenv emu + $ cd emu/ + $ python setup.py develop + +4. Create a branch for local development:: + + $ git checkout -b name-of-your-bugfix-or-feature + + Now you can make your changes locally. + +5. When you're done making changes, check that your changes pass flake8 and the + tests, including testing other Python versions with tox:: + + $ flake8 emu tests + $ python setup.py test or pytest + $ tox + + To get flake8 and tox, just pip install them into your virtualenv. + +6. Commit your changes and push your branch to GitHub:: + + $ git add . + $ git commit -m "Your detailed description of your changes." + $ git push origin name-of-your-bugfix-or-feature + +7. Submit a pull request through the GitHub website. + +Pull Request Guidelines +----------------------- + +Before you submit a pull request, check that it meets these guidelines: + +1. The pull request should include tests. +2. If the pull request adds functionality, the docs should be updated. Put + your new functionality into a function with a docstring, and add the + feature to the list in README.rst. +3. The pull request should work for Python 3.5, 3.6, 3.7 and 3.8, and for PyPy. Check + https://travis-ci.com/bird-house/emu/pull_requests + and make sure that the tests pass for all supported Python versions. + +Tips +---- + +To run a subset of tests:: + +$ pytest tests.test_emu + + +Deploying +--------- + +A reminder for the maintainers on how to deploy. +Make sure all your changes are committed (including an entry in HISTORY.rst). +Then run:: + +$ bump2version patch # possible: major / minor / patch +$ git push +$ git push --tags + +Travis will then deploy to PyPI if tests pass. diff --git a/LICENSE.txt b/LICENSE similarity index 94% rename from LICENSE.txt rename to LICENSE index 54a2700..dec829d 100644 --- a/LICENSE.txt +++ b/LICENSE @@ -1,4 +1,20 @@ -Apache License +Apache Software License 2.0 + +Copyright (c) 2023, Carsten Ehbrecht + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + + Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ diff --git a/MANIFEST.in b/MANIFEST.in index 8121610..29e1c74 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,6 +1,7 @@ include Makefile include *.txt include *.rst +include tox.ini recursive-include emu * global-exclude __pycache__ global-exclude *.py[co] diff --git a/README.rst b/README.rst index 28d7eb9..2a008b2 100644 --- a/README.rst +++ b/README.rst @@ -45,10 +45,13 @@ You can find information about contributing in our `Developer Guide`_. Please use bumpversion_ to release a new version. + License ------- -Free software: Apache Software License 2.0 +* Free software: Apache Software License 2.0 +* Documentation: https://emu.readthedocs.io. + Credits ------- diff --git a/docs/source/.gitignore b/docs/source/.gitignore deleted file mode 100644 index 44dadd1..0000000 --- a/docs/source/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/emu.rst -/emu.*.rst -/modules.rst diff --git a/docs/source/authors.rst b/docs/source/authors.rst new file mode 100644 index 0000000..7739272 --- /dev/null +++ b/docs/source/authors.rst @@ -0,0 +1 @@ +.. include:: ../../AUTHORS.rst diff --git a/docs/source/conf.py b/docs/source/conf.py index 2726d97..bdb3305 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,5 +1,4 @@ #!/usr/bin/env python -# -*- coding: utf-8 -*- # # emu documentation build configuration file, created by # sphinx-quickstart on Fri Jun 9 13:47:02 2017. @@ -90,9 +89,9 @@ # the built documents. # # The short X.Y version. -version = "0.12.0" +version = emu.__version__ # The full version, including alpha/beta/rc tags. -release = "0.12.0" +release = emu.__version__ # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/source/index.rst b/docs/source/index.rst index cf12d70..88abb05 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -9,6 +9,7 @@ dev_guide tutorial processes + authors changes Indices and tables diff --git a/emu/__version__.py b/emu/__version__.py index 9fce8b0..5428f8d 100644 --- a/emu/__version__.py +++ b/emu/__version__.py @@ -4,6 +4,6 @@ # without importing the main package when its dependencies are not installed. # See: https://packaging.python.org/guides/single-sourcing-package-version -__author__ = """Carsten Ehbrecht""" -__email__ = 'ehbrecht@dkrz.de' -__version__ = '0.12.0' +__author__ = "Carsten Ehbrecht" +__email__ = "ehbrecht@dkrz.de" +__version__ = "0.12.0" diff --git a/emu/cli.py b/emu/cli.py index 2004be6..4129ea2 100644 --- a/emu/cli.py +++ b/emu/cli.py @@ -131,9 +131,11 @@ def stop(): @click.option('--log-level', metavar='LEVEL', default='INFO', help='log level in PyWPS configuration.') @click.option('--log-file', metavar='PATH', default='pywps.log', help='log file in PyWPS configuration.') @click.option('--database', default='sqlite:///pywps-logs.sqlite', help='database in PyWPS configuration') +@click.option('--outputurl', default='', help='base URL for file downloads') +@click.option('--outputpath', default='', help='base directory where outputs are written') def start(config, bind_host, daemon, hostname, port, maxsingleinputsize, maxprocesses, parallelprocesses, - log_level, log_file, database): + log_level, log_file, database, outputurl, outputpath): """Start PyWPS service. This service is by default available at http://localhost:5000/wps """ @@ -150,6 +152,8 @@ def start(config, bind_host, daemon, hostname, port, wps_log_level=log_level, wps_log_file=log_file, wps_database=database, + wps_outputurl=outputurl, + wps_outputpath=outputpath )) if config: cfgfiles.append(config) diff --git a/requirements_dev.txt b/requirements_dev.txt index 5ba6c76..4f2deaf 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -1,14 +1,17 @@ pytest>=6.0 +pytest-runner +pytest-cov flake8 +tox pytest-flake8 ipython pytest-notebook nbsphinx nbval>=0.9.6 nbconvert -sphinx>=1.7 -bumpversion -twine +sphinx>=1.8.5 +bump2version +Click cruft # Changing dependencies above this comment will create merge conflicts when updating the cookiecutter template with cruft. Add extra requirements below this line. locust diff --git a/setup.cfg b/setup.cfg index b0f45be..0373bac 100644 --- a/setup.cfg +++ b/setup.cfg @@ -11,7 +11,7 @@ search = __version__ = '{current_version}' replace = __version__ = '{new_version}' [bumpversion:file:docs/source/conf.py] -search = version|release = {current_version} +parse = version|release = {current_version} replace = {new_version} [bumpversion:file:Dockerfile] @@ -45,6 +45,16 @@ exclude = dist, src, -[doc8] -ignore-path = docs/build,docs/source/_templates,docs/source/_static -max-line-length = 120 +[aliases] +# Define setup.py command aliases here +test = pytest + +[tool:pytest] +addopts = + --strict-markers + --tb=native + tests/ +python_files = test_*.py +markers = + online: mark test to need internet connection + slow: mark test to be slow diff --git a/setup.py b/setup.py index bdf1f8d..d479fbd 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,4 @@ #!/usr/bin/env python -# -*- coding: utf-8 -*- """The setup script.""" diff --git a/tests/__init__.py b/tests/__init__.py index 1d1c435..1f41eb7 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,3 +1 @@ -# -*- coding: utf-8 -*- - """Unit test package for emu.""" diff --git a/tests/test_emu.py b/tests/test_emu.py new file mode 100644 index 0000000..299df3a --- /dev/null +++ b/tests/test_emu.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +"""Tests for `emu` package.""" + +import pytest + +from click.testing import CliRunner + +import emu +from emu import cli + + +@pytest.fixture +def response(): + """Sample pytest fixture. + + See more at: http://doc.pytest.org/en/latest/fixture.html + """ + # import requests + # return requests.get('https://github.com/audreyr/cookiecutter-pypackage') + + +def test_content(response): + """Sample pytest test function with the pytest fixture as an argument.""" + # from bs4 import BeautifulSoup + # assert 'GitHub' in BeautifulSoup(response.content).title.string diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..479c6d9 --- /dev/null +++ b/tox.ini @@ -0,0 +1,29 @@ +[tox] +envlist = py36, py37, py38, flake8 +requires = pip >= 20.0 +opts = -v + +[travis] +python = + 3.8: py38 + 3.7: py37 + 3.6: py36 + +[testenv:flake8] +basepython = python +deps = flake8 +commands = flake8 emu tests + +[testenv] +setenv = + PYTHONPATH = {toxinidir} +install_command = python -m pip install --no-user {opts} {packages} +download = True +deps = + -r{toxinidir}/requirements_dev.txt +; If you want to make tox run the tests with the same versions, create a +; requirements.txt with the pinned versions and uncomment the following line: +; -r{toxinidir}/requirements.txt +commands = + pytest --basetemp={envtmpdir} + From 1f5571fbd3889200e607f4f49c74ce00c66267f9 Mon Sep 17 00:00:00 2001 From: Pingu Carsti Date: Thu, 30 Nov 2023 15:34:27 +0100 Subject: [PATCH 02/14] clean up env --- .readthedocs.yml | 2 +- environment-docs.yml | 3 +-- environment.yml | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index d92d702..a6b01b2 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -10,7 +10,7 @@ sphinx: configuration: docs/source/conf.py # fail_on_warning might generate hard to fix error, in this case it can be # disabled but this also means those errors will fail silently, choose wisely. - fail_on_warning: true + # fail_on_warning: true # Build documentation with MkDocs #mkdocs: diff --git a/environment-docs.yml b/environment-docs.yml index cf289d8..4d55a14 100644 --- a/environment-docs.yml +++ b/environment-docs.yml @@ -2,9 +2,8 @@ name: emu-docs channels: - conda-forge -- defaults dependencies: -- pywps=4.4.0 +- pywps >=4.5.2 - sphinx - nbsphinx - ipython diff --git a/environment.yml b/environment.yml index f44db79..a69169c 100644 --- a/environment.yml +++ b/environment.yml @@ -4,8 +4,8 @@ channels: - defaults dependencies: - pip -- python>=3.7,<3.10 -- pywps>=4.5.1,<4.6 +- python>=3.8,<3.12 +- pywps>=4.5.2,<4.7 - jinja2 - click - psutil From dc80e567f9a79ab038f019c48fcc6859bea6a269 Mon Sep 17 00:00:00 2001 From: Pingu Carsti Date: Thu, 30 Nov 2023 15:34:50 +0100 Subject: [PATCH 03/14] update requirements --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 59bc20a..147d6b7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -pywps>=4.5.1 +pywps>=4.5.2 jinja2 click psutil From 97e49bd0e6a5c48107fada50e2897f55fa7844ee Mon Sep 17 00:00:00 2001 From: Pingu Carsti Date: Thu, 30 Nov 2023 15:35:19 +0100 Subject: [PATCH 04/14] removed travis config --- .travis.yml | 43 ------------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 336464e..0000000 --- a/.travis.yml +++ /dev/null @@ -1,43 +0,0 @@ -dist: xenial # required for Python >= 3.7 -language: python -os: - - linux -python: - - "3.6" - - "3.7" - - "3.8" -# - osx -sudo: false -before_install: - # Useful for debugging Travis CI environment - - printenv -install: - # Python 3.x is default - - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh - - bash miniconda.sh -b -p $HOME/miniconda - - export PATH="$HOME/miniconda/bin:$PATH" - - hash -r - - conda config --set always_yes yes --set changeps1 no - - conda install setuptools - - conda update -q conda - # Useful for debugging any issues with conda - - conda info -a - # Prepare env with Python version - - conda create -n emu -c conda-forge python=$TRAVIS_PYTHON_VERSION - # Update now the env with our environment - - conda env update -f environment.yml - - source activate emu - # Packages for testing, generating docs and installing WPS - - make develop -before_script: - # Start WPS service on port 5000 on 0.0.0.0 - - emu start --daemon --bind-host 0.0.0.0 --port 5000 - - sleep 2 -script: - - pytest -v -m 'not online' tests/ - # No notebooks in emu yet. - #- make test-notebooks - - flake8 - - make docs # default html - - make SPHINXOPTS='-b epub' docs # to match RtD - - make SPHINXOPTS='-b latex' docs # to match RtD From 4297381d0c6878e8d9816db9b1378677bfc1b00c Mon Sep 17 00:00:00 2001 From: Pingu Carsti Date: Thu, 30 Nov 2023 15:37:34 +0100 Subject: [PATCH 05/14] update minimal python >=3.8 --- .github/workflows/main.yml | 10 ++--- setup.py | 88 ++++++++++++++++++++------------------ 2 files changed, 51 insertions(+), 47 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d79afbd..a497445 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.7, 3.8, 3.9] + python-version: ["3.8", "3.9", "3.10", "3.11"] steps: - name: Checkout repository and submodules uses: actions/checkout@v2 @@ -31,15 +31,15 @@ jobs: run: make test - name: Lint with flake8 ⚙️ run: make lint - if: matrix.python-version == 3.7 + if: matrix.python-version == 3.8 # - name: Check formatting with black ⚙️ - # run: black --check --target-version py37 birdy tests + # run: black --check --target-version py38 birdy tests # if: matrix.python-version == 3.7 - name: Build docs 🏗️ run: make docs - if: matrix.python-version == 3.7 + if: matrix.python-version == 3.8 # - name: Run smoke tests ⚙️ # run: | # export PYWPS_CFG=$PWD/etc/smoke-pywps.cfg # make smoke - # if: matrix.python-version == 3.7 + # if: matrix.python-version == 3.8 diff --git a/setup.py b/setup.py index d479fbd..e97c5d2 100644 --- a/setup.py +++ b/setup.py @@ -7,54 +7,58 @@ from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) -README = open(os.path.join(here, 'README.rst')).read() -CHANGES = open(os.path.join(here, 'CHANGES.rst')).read() -REQUIRES_PYTHON = ">=3.7.0" +README = open(os.path.join(here, "README.rst")).read() +CHANGES = open(os.path.join(here, "CHANGES.rst")).read() +REQUIRES_PYTHON = ">=3.8.0" about = {} -with open(os.path.join(here, 'emu', '__version__.py'), 'r') as f: +with open(os.path.join(here, "emu", "__version__.py"), "r") as f: exec(f.read(), about) -reqs = [line.strip() for line in open('requirements.txt')] -dev_reqs = [line.strip() for line in open('requirements_dev.txt')] +reqs = [line.strip() for line in open("requirements.txt")] +dev_reqs = [line.strip() for line in open("requirements_dev.txt")] extra_reqs = [line.strip() for line in open("requirements_extra.txt")] classifiers = [ - 'Development Status :: 3 - Alpha', - 'Intended Audience :: Developers', - 'Intended Audience :: Science/Research', - 'Operating System :: MacOS :: MacOS X', - 'Operating System :: POSIX', - 'Programming Language :: Python', - 'Natural Language :: English', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Topic :: Scientific/Engineering :: Atmospheric Science', - 'License :: OSI Approved :: Apache Software License', + "Development Status :: 3 - Alpha", + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "Operating System :: MacOS :: MacOS X", + "Operating System :: POSIX", + "Programming Language :: Python", + "Natural Language :: English", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Topic :: Scientific/Engineering :: Atmospheric Science", + "License :: OSI Approved :: Apache Software License", ] -setup(name='emu', - version=about['__version__'], - description="WPS processes for testing and demo", - long_description=README + '\n\n' + CHANGES, - long_description_content_type="text/x-rst", - author=about['__author__'], - author_email=about['__email__'], - url='https://github.com/bird-house/emu', - python_requires=REQUIRES_PYTHON, - classifiers=classifiers, - license="Apache Software License 2.0", - keywords='wps pywps birdhouse emu', - packages=find_packages(), - include_package_data=True, - install_requires=reqs, - extras_require={ - "extra:": extra_reqs, - "dev": dev_reqs, # pip install ".[dev]" - }, - entry_points={ - 'console_scripts': [ - 'emu=emu.cli:cli', - ]},) +setup( + name="emu", + version=about["__version__"], + description="WPS processes for testing and demo", + long_description=README + "\n\n" + CHANGES, + long_description_content_type="text/x-rst", + author=about["__author__"], + author_email=about["__email__"], + url="https://github.com/bird-house/emu", + python_requires=REQUIRES_PYTHON, + classifiers=classifiers, + license="Apache Software License 2.0", + keywords="wps pywps birdhouse emu", + packages=find_packages(), + include_package_data=True, + install_requires=reqs, + extras_require={ + "extra:": extra_reqs, + "dev": dev_reqs, # pip install ".[dev]" + }, + entry_points={ + "console_scripts": [ + "emu=emu.cli:cli", + ] + }, +) From 1070515c0c57b9a63c2ddc22010443702b7c26b5 Mon Sep 17 00:00:00 2001 From: Pingu Carsti Date: Thu, 30 Nov 2023 15:38:31 +0100 Subject: [PATCH 06/14] update tox.ini --- tox.ini | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index 479c6d9..f7f74ef 100644 --- a/tox.ini +++ b/tox.ini @@ -1,13 +1,12 @@ [tox] -envlist = py36, py37, py38, flake8 +envlist = py38, py39, flake8 requires = pip >= 20.0 opts = -v [travis] python = + 3.9: py39 3.8: py38 - 3.7: py37 - 3.6: py36 [testenv:flake8] basepython = python From a48d8b11e06a8d4199c0d43fba12ebc3f1dcf95a Mon Sep 17 00:00:00 2001 From: Pingu Carsti Date: Thu, 30 Nov 2023 15:42:39 +0100 Subject: [PATCH 07/14] fix setup.cfg --- setup.cfg | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/setup.cfg b/setup.cfg index 0373bac..af0482b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -23,12 +23,12 @@ search = "version": "{current_version}", replace = "version": "{new_version}", [tool:pytest] -addopts = +addopts = + --color=yes --strict --tb=native - tests/ python_files = test_*.py -markers = +markers = online: mark test to need internet connection slow: mark test to be slow flaky: mark test to be flaky @@ -48,13 +48,3 @@ exclude = [aliases] # Define setup.py command aliases here test = pytest - -[tool:pytest] -addopts = - --strict-markers - --tb=native - tests/ -python_files = test_*.py -markers = - online: mark test to need internet connection - slow: mark test to be slow From 0e2288b0a1930bc3f99f1790d0252e4e05449af9 Mon Sep 17 00:00:00 2001 From: Pingu Carsti Date: Thu, 30 Nov 2023 16:07:12 +0100 Subject: [PATCH 08/14] fix docs version --- docs/source/conf.py | 60 +++++++++++++++++++++++++++++++++------------ 1 file changed, 45 insertions(+), 15 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index bdb3305..452d7ce 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -50,22 +50,52 @@ # To avoid having to install these and burst memory limit on ReadTheDocs. # List of all tested working mock imports from all birds so new birds can # inherit without having to test which work which do not. -autodoc_mock_imports = ["numpy", "xarray", "fiona", "rasterio", "shapely", - "osgeo", "geopandas", "pandas", "statsmodels", - "affine", "rasterstats", "spotpy", "matplotlib", - "scipy", "unidecode", "gdal", "sentry_sdk", "dask", - "numba", "parse", "siphon", "sklearn", "cftime", - "netCDF4", "bottleneck", "ocgis", "geotiff", "geos", - "hdf4", "hdf5", "zlib", "pyproj", "proj", "cartopy", - "scikit-learn", "cairo"] +autodoc_mock_imports = [ + "numpy", + "xarray", + "fiona", + "rasterio", + "shapely", + "osgeo", + "geopandas", + "pandas", + "statsmodels", + "affine", + "rasterstats", + "spotpy", + "matplotlib", + "scipy", + "unidecode", + "gdal", + "sentry_sdk", + "dask", + "numba", + "parse", + "siphon", + "sklearn", + "cftime", + "netCDF4", + "bottleneck", + "ocgis", + "geotiff", + "geos", + "hdf4", + "hdf5", + "zlib", + "pyproj", + "proj", + "cartopy", + "scikit-learn", + "cairo", +] # Monkeypatch constant because the following are mock imports. # Only works if numpy is actually installed and at the same time being mocked. -#import numpy -#numpy.pi = 3.1416 +# import numpy +# numpy.pi = 3.1416 # We are using mock imports in readthedocs, so probably safer to not run the notebooks -nbsphinx_execute = 'never' +nbsphinx_execute = "never" # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] @@ -81,7 +111,7 @@ # General information about the project. project = "Emu" -copyright = "2018-2020, Carsten Ehbrecht" +copyright = "2018-2023, Carsten Ehbrecht" author = "Carsten Ehbrecht" # The version info for the project you're documenting, acts as replacement @@ -89,9 +119,9 @@ # the built documents. # # The short X.Y version. -version = emu.__version__ +version = "0.12.0" # The full version, including alpha/beta/rc tags. -release = emu.__version__ +release = "0.12.0" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -112,7 +142,7 @@ todo_include_todos = False # Suppress "WARNING: unknown mimetype for ..." when building EPUB. -suppress_warnings = ['epub.unknown_project_files'] +suppress_warnings = ["epub.unknown_project_files"] # Avoid "configuration.rst:4:duplicate label configuration, other instance in configuration.rst" autosectionlabel_prefix_document = True From 5ec8d563105b1b0742b2d97fe64c8b9ad38877d4 Mon Sep 17 00:00:00 2001 From: Pingu Carsti Date: Thu, 30 Nov 2023 16:12:48 +0100 Subject: [PATCH 09/14] fix docs config --- docs/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 452d7ce..82fad26 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -128,7 +128,7 @@ # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = None +language = "en" # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. From 4429e18259538cb8bb9c7b70800fb004415dd2ce Mon Sep 17 00:00:00 2001 From: Pingu Carsti Date: Thu, 30 Nov 2023 16:19:17 +0100 Subject: [PATCH 10/14] revert rtd config --- .readthedocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index a6b01b2..d92d702 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -10,7 +10,7 @@ sphinx: configuration: docs/source/conf.py # fail_on_warning might generate hard to fix error, in this case it can be # disabled but this also means those errors will fail silently, choose wisely. - # fail_on_warning: true + fail_on_warning: true # Build documentation with MkDocs #mkdocs: From 1adec20642ed5629ca506a32a6b9254544bc0081 Mon Sep 17 00:00:00 2001 From: Pingu Carsti Date: Thu, 30 Nov 2023 16:32:45 +0100 Subject: [PATCH 11/14] update rdt config --- .readthedocs.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index d92d702..ea3dd1d 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -10,21 +10,24 @@ sphinx: configuration: docs/source/conf.py # fail_on_warning might generate hard to fix error, in this case it can be # disabled but this also means those errors will fail silently, choose wisely. - fail_on_warning: true + fail_on_warning: false # Build documentation with MkDocs #mkdocs: # configuration: mkdocs.yml # Optionally build your docs in additional formats such as PDF and ePub -formats: all +formats: [] -# Optionally set the version of Python and requirements required to build your docs -#python: -# version: 3.6 +build: + os: ubuntu-22.04 + tools: + python: "mambaforge-22.9" conda: - environment: environment-docs.yml + environment: environment.yml -build: - image: stable +# Optionally set the version of Python and requirements required to build your docs +python: + install: + - requirements: requirements_dev.txt From 84dc361afd6b5b998e0c597e1ae393799f2c2ea4 Mon Sep 17 00:00:00 2001 From: MacPingu Date: Thu, 30 Nov 2023 18:20:57 +0100 Subject: [PATCH 12/14] Update .readthedocs.yml Co-authored-by: Trevor James Smith <10819524+Zeitsperre@users.noreply.github.com> --- .readthedocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index ea3dd1d..67c269d 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -25,7 +25,7 @@ build: python: "mambaforge-22.9" conda: - environment: environment.yml + environment: environment-docs.yml # Optionally set the version of Python and requirements required to build your docs python: From 2013721f9bcd5da1cec9e74bb8f91ef25eb17f98 Mon Sep 17 00:00:00 2001 From: Pingu Carsti Date: Thu, 30 Nov 2023 18:29:01 +0100 Subject: [PATCH 13/14] update after review --- .readthedocs.yml | 2 +- CONTRIBUTING.rst | 128 ------------------------------------------- requirements_dev.txt | 4 +- tests/test_emu.py | 26 --------- tox.ini | 28 ---------- 5 files changed, 2 insertions(+), 186 deletions(-) delete mode 100644 CONTRIBUTING.rst delete mode 100644 tests/test_emu.py delete mode 100644 tox.ini diff --git a/.readthedocs.yml b/.readthedocs.yml index ea3dd1d..4ce930d 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -10,7 +10,7 @@ sphinx: configuration: docs/source/conf.py # fail_on_warning might generate hard to fix error, in this case it can be # disabled but this also means those errors will fail silently, choose wisely. - fail_on_warning: false + fail_on_warning: true # Build documentation with MkDocs #mkdocs: diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst deleted file mode 100644 index 406e43c..0000000 --- a/CONTRIBUTING.rst +++ /dev/null @@ -1,128 +0,0 @@ -.. highlight:: shell - -============ -Contributing -============ - -Contributions are welcome, and they are greatly appreciated! Every little bit -helps, and credit will always be given. - -You can contribute in many ways: - -Types of Contributions ----------------------- - -Report Bugs -~~~~~~~~~~~ - -Report bugs at https://github.com/bird-house/emu/issues. - -If you are reporting a bug, please include: - -* Your operating system name and version. -* Any details about your local setup that might be helpful in troubleshooting. -* Detailed steps to reproduce the bug. - -Fix Bugs -~~~~~~~~ - -Look through the GitHub issues for bugs. Anything tagged with "bug" and "help -wanted" is open to whoever wants to implement it. - -Implement Features -~~~~~~~~~~~~~~~~~~ - -Look through the GitHub issues for features. Anything tagged with "enhancement" -and "help wanted" is open to whoever wants to implement it. - -Write Documentation -~~~~~~~~~~~~~~~~~~~ - -Emu could always use more documentation, whether as part of the -official Emu docs, in docstrings, or even on the web in blog posts, -articles, and such. - -Submit Feedback -~~~~~~~~~~~~~~~ - -The best way to send feedback is to file an issue at https://github.com/bird-house/emu/issues. - -If you are proposing a feature: - -* Explain in detail how it would work. -* Keep the scope as narrow as possible, to make it easier to implement. -* Remember that this is a volunteer-driven project, and that contributions - are welcome :) - -Get Started! ------------- - -Ready to contribute? Here's how to set up `emu` for local development. - -1. Fork the `emu` repo on GitHub. -2. Clone your fork locally:: - - $ git clone git@github.com:your_name_here/emu.git - -3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development:: - - $ mkvirtualenv emu - $ cd emu/ - $ python setup.py develop - -4. Create a branch for local development:: - - $ git checkout -b name-of-your-bugfix-or-feature - - Now you can make your changes locally. - -5. When you're done making changes, check that your changes pass flake8 and the - tests, including testing other Python versions with tox:: - - $ flake8 emu tests - $ python setup.py test or pytest - $ tox - - To get flake8 and tox, just pip install them into your virtualenv. - -6. Commit your changes and push your branch to GitHub:: - - $ git add . - $ git commit -m "Your detailed description of your changes." - $ git push origin name-of-your-bugfix-or-feature - -7. Submit a pull request through the GitHub website. - -Pull Request Guidelines ------------------------ - -Before you submit a pull request, check that it meets these guidelines: - -1. The pull request should include tests. -2. If the pull request adds functionality, the docs should be updated. Put - your new functionality into a function with a docstring, and add the - feature to the list in README.rst. -3. The pull request should work for Python 3.5, 3.6, 3.7 and 3.8, and for PyPy. Check - https://travis-ci.com/bird-house/emu/pull_requests - and make sure that the tests pass for all supported Python versions. - -Tips ----- - -To run a subset of tests:: - -$ pytest tests.test_emu - - -Deploying ---------- - -A reminder for the maintainers on how to deploy. -Make sure all your changes are committed (including an entry in HISTORY.rst). -Then run:: - -$ bump2version patch # possible: major / minor / patch -$ git push -$ git push --tags - -Travis will then deploy to PyPI if tests pass. diff --git a/requirements_dev.txt b/requirements_dev.txt index 4f2deaf..450752c 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -1,5 +1,4 @@ pytest>=6.0 -pytest-runner pytest-cov flake8 tox @@ -10,8 +9,7 @@ nbsphinx nbval>=0.9.6 nbconvert sphinx>=1.8.5 -bump2version -Click +bump-my-version cruft # Changing dependencies above this comment will create merge conflicts when updating the cookiecutter template with cruft. Add extra requirements below this line. locust diff --git a/tests/test_emu.py b/tests/test_emu.py deleted file mode 100644 index 299df3a..0000000 --- a/tests/test_emu.py +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env python - -"""Tests for `emu` package.""" - -import pytest - -from click.testing import CliRunner - -import emu -from emu import cli - - -@pytest.fixture -def response(): - """Sample pytest fixture. - - See more at: http://doc.pytest.org/en/latest/fixture.html - """ - # import requests - # return requests.get('https://github.com/audreyr/cookiecutter-pypackage') - - -def test_content(response): - """Sample pytest test function with the pytest fixture as an argument.""" - # from bs4 import BeautifulSoup - # assert 'GitHub' in BeautifulSoup(response.content).title.string diff --git a/tox.ini b/tox.ini deleted file mode 100644 index f7f74ef..0000000 --- a/tox.ini +++ /dev/null @@ -1,28 +0,0 @@ -[tox] -envlist = py38, py39, flake8 -requires = pip >= 20.0 -opts = -v - -[travis] -python = - 3.9: py39 - 3.8: py38 - -[testenv:flake8] -basepython = python -deps = flake8 -commands = flake8 emu tests - -[testenv] -setenv = - PYTHONPATH = {toxinidir} -install_command = python -m pip install --no-user {opts} {packages} -download = True -deps = - -r{toxinidir}/requirements_dev.txt -; If you want to make tox run the tests with the same versions, create a -; requirements.txt with the pinned versions and uncomment the following line: -; -r{toxinidir}/requirements.txt -commands = - pytest --basetemp={envtmpdir} - From 6bd74f5f23593f0c26e9ce1c2d24c3adbc0342f3 Mon Sep 17 00:00:00 2001 From: Pingu Carsti Date: Thu, 30 Nov 2023 18:31:34 +0100 Subject: [PATCH 14/14] restrict python >=3.8 --- environment-docs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/environment-docs.yml b/environment-docs.yml index 4d55a14..0a09dcb 100644 --- a/environment-docs.yml +++ b/environment-docs.yml @@ -3,6 +3,7 @@ name: emu-docs channels: - conda-forge dependencies: +- python >=3.8,<3.11 - pywps >=4.5.2 - sphinx - nbsphinx