From 99d977328c1d1a54fed806009f1f3c2253b13c54 Mon Sep 17 00:00:00 2001 From: MacPingu Date: Thu, 11 Apr 2019 10:29:55 +0200 Subject: [PATCH] Fix 67 simplify (#68) * skip python 2.7 support --- .travis.yml | 3 ++- README.rst | 16 ++++++++++++---- environment.yml | 11 +++++------ {{cookiecutter.project_repo_name}}/.travis.yml | 3 ++- {{cookiecutter.project_repo_name}}/Makefile | 7 ++++++- .../environment.yml | 8 ++++++-- {{cookiecutter.project_repo_name}}/setup.py | 2 +- .../{{cookiecutter.project_slug}}/cli.py | 2 +- .../processes/wps_say_hello.py | 2 ++ 9 files changed, 37 insertions(+), 17 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8540d013b..4d5564552 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ +dist: xenial # required for Python >= 3.7 language: python - - 2.7 - 3.6 + - 3.7 install: - if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh; diff --git a/README.rst b/README.rst index 98eb6bd3d..eebdc3a22 100644 --- a/README.rst +++ b/README.rst @@ -50,15 +50,21 @@ Installation ------------ Prior to installing cookiecutter-birdhouse, the cookiecutter package must be installed in your environment. -This is achieved via the following command:: +This is achieved via the following command: + +.. code-block:: console $ conda install -c conda-forge cookiecutter -With cookiecutter installed, the cookiecutter-birdhouse template can be installed with:: +With cookiecutter installed, the cookiecutter-birdhouse template can be installed with: + +.. code-block:: console $ cookiecutter https://github.com/bird-house/cookiecutter-birdhouse.git -Once cookiecutter clones the template, you will be asked a series of questions related to your project:: +Once cookiecutter clones the template, you will be asked a series of questions related to your project: + +.. code-block:: console $ full_name [Full Name]: Enter your full name. @@ -101,7 +107,9 @@ Development ----------- If you want to extend the cookiecutter template then prepare your development -environment as follows:: +environment as follows: + +.. code-block:: console # clone repo $ git clone git@github.com:bird-house/cookiecutter-birdhouse.git diff --git a/environment.yml b/environment.yml index eeca99b6d..784ae7d7d 100644 --- a/environment.yml +++ b/environment.yml @@ -1,13 +1,12 @@ name: cookiecutter-birdhouse channels: -- conda-forge - defaults dependencies: -- cookiecutter - cryptography - pyyaml -- bumpversion -- watchdog -# tests - pytest -- pytest-cookies +- pip: + - cookiecutter + - bumpversion + - watchdog + - pytest-cookies diff --git a/{{cookiecutter.project_repo_name}}/.travis.yml b/{{cookiecutter.project_repo_name}}/.travis.yml index f1e639718..d618f0341 100644 --- a/{{cookiecutter.project_repo_name}}/.travis.yml +++ b/{{cookiecutter.project_repo_name}}/.travis.yml @@ -1,7 +1,8 @@ +dist: xenial # required for Python >= 3.7 language: python python: - - "2.7" - "3.6" + - "3.7" branches: only: - master diff --git a/{{cookiecutter.project_repo_name}}/Makefile b/{{cookiecutter.project_repo_name}}/Makefile index 17eb4f742..84173db8f 100644 --- a/{{cookiecutter.project_repo_name}}/Makefile +++ b/{{cookiecutter.project_repo_name}}/Makefile @@ -23,6 +23,7 @@ help: @echo " install to install $(APP_NAME) by running 'python setup.py develop'." @echo " start to start $(APP_NAME) service as daemon (background process)." @echo " stop to stop $(APP_NAME) service." + @echo " restart to restart $(APP_NAME) service." @echo " status to show status of $(APP_NAME) service." @echo " clean to remove *all* files that are not controlled by 'git'. WARNING: use it *only* if you know what you do!" @echo "\nTesting targets:" @@ -66,7 +67,7 @@ bootstrap: check_conda conda_env bootstrap_dev .PHONY: bootstrap_dev bootstrap_dev: @echo "Installing development requirements for tests and docs ..." - @-bash -c "$(CONDA) install -y -n $(CONDA_ENV) -c conda-forge pytest flake8 sphinx bumpversion gunicorn psycopg2" + @-bash -c "$(CONDA) install -y -n $(CONDA_ENV) pytest flake8 sphinx gunicorn psycopg2" @-bash -c "source $(ANACONDA_HOME)/bin/activate $(CONDA_ENV) && pip install -r requirements_dev.txt" .PHONY: install @@ -85,6 +86,10 @@ stop: check_conda @echo "Stopping application ..." @-bash -c "source $(ANACONDA_HOME)/bin/activate $(CONDA_ENV) && $(APP_NAME) stop" +.PHONY: restart +restart: stop start + @echo "Restarting application ..." + .PHONY: status status: check_conda @echo "Show status ..." diff --git a/{{cookiecutter.project_repo_name}}/environment.yml b/{{cookiecutter.project_repo_name}}/environment.yml index 9bdab5d05..3d301baaf 100644 --- a/{{cookiecutter.project_repo_name}}/environment.yml +++ b/{{cookiecutter.project_repo_name}}/environment.yml @@ -1,9 +1,13 @@ name: {{ cookiecutter.project_slug }} channels: -- conda-forge +#- conda-forge - defaults dependencies: -- pywps=4.2 +#- pywps=4.2 - jinja2 - click - psutil +# tests +- pytest +- pip: + - -e git+https://github.com/geopython/pywps@master#egg=pywps diff --git a/{{cookiecutter.project_repo_name}}/setup.py b/{{cookiecutter.project_repo_name}}/setup.py index 29bdc8b10..2337c28c3 100644 --- a/{{cookiecutter.project_repo_name}}/setup.py +++ b/{{cookiecutter.project_repo_name}}/setup.py @@ -60,5 +60,5 @@ install_requires=reqs, entry_points={ 'console_scripts': [ - '{{ cookiecutter.project_slug }}={{ cookiecutter.project_slug }}.cli:cli', + '{{ cookiecutter.project_slug }}={{ cookiecutter.project_slug }}.cli:cli', ]},) diff --git a/{{cookiecutter.project_repo_name}}/{{cookiecutter.project_slug}}/cli.py b/{{cookiecutter.project_repo_name}}/{{cookiecutter.project_slug}}/cli.py index f0edaf691..d8b0da7fc 100644 --- a/{{cookiecutter.project_repo_name}}/{{cookiecutter.project_slug}}/cli.py +++ b/{{cookiecutter.project_repo_name}}/{{cookiecutter.project_slug}}/cli.py @@ -12,7 +12,7 @@ from pywps import configuration from . import wsgi -from six.moves.urllib.parse import urlparse +from urllib.parse import urlparse PID_FILE = os.path.abspath(os.path.join(os.path.curdir, "pywps.pid")) diff --git a/{{cookiecutter.project_repo_name}}/{{cookiecutter.project_slug}}/processes/wps_say_hello.py b/{{cookiecutter.project_repo_name}}/{{cookiecutter.project_slug}}/processes/wps_say_hello.py index 22aade106..2d67782d9 100644 --- a/{{cookiecutter.project_repo_name}}/{{cookiecutter.project_slug}}/processes/wps_say_hello.py +++ b/{{cookiecutter.project_repo_name}}/{{cookiecutter.project_slug}}/processes/wps_say_hello.py @@ -27,8 +27,10 @@ def __init__(self): 'Returns a literal string output with Hello plus the inputed name.', keywords=['hello', 'demo'], metadata=[ + Metadata('PyWPS', 'https://pywps.org/'), Metadata('Birdhouse', 'http://bird-house.github.io/'), Metadata('PyWPS Demo', 'https://pywps-demo.readthedocs.io/en/latest/'), + Metadata('Emu: PyWPS examples', 'https://emu.readthedocs.io/en/latest/'), ], version='1.5', inputs=inputs,