Skip to content

Commit

Permalink
Merge pull request #24 from bird-house/updates-from-cookiecutter
Browse files Browse the repository at this point in the history
updated to latest cookiecutter template
  • Loading branch information
cehbrecht committed Dec 5, 2018
2 parents 124594b + bb7c7ef commit f05d230
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 19 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ language: python
python:
- "2.7"
- "3.6"
branches:
only:
- master
os:
- linux
# - osx
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# vim:set ft=dockerfile:
FROM continuumio/miniconda3
MAINTAINER https://github.com/bird-house/hummingbird
LABEL Description="Hummingbird WPS" Vendor="Birdhouse" Version="Version="0.6.0""
LABEL Description="Hummingbird WPS" Vendor="Birdhouse" Version="0.6.0"

# Update Debian system
RUN apt-get update && apt-get install -y \
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,17 @@ distclean: clean
.PHONY: test
test: check_conda
@echo "Running tests (skip slow and online tests) ..."
@-bash -c "source $(ANACONDA_HOME)/bin/activate $(CONDA_ENV);pytest -v -m 'not slow and not online'"
@bash -c "source $(ANACONDA_HOME)/bin/activate $(CONDA_ENV);pytest -v -m 'not slow and not online'"

.PHONY: testall
testall: check_conda
@echo "Running all tests (including slow and online tests) ..."
@-bash -c "source $(ANACONDA_HOME)/bin/activate $(CONDA_ENV) && pytest -v"
@bash -c "source $(ANACONDA_HOME)/bin/activate $(CONDA_ENV) && pytest -v"

.PHONY: pep8
pep8: check_conda
@echo "Running pep8 code style checks ..."
@-bash -c "source $(ANACONDA_HOME)/bin/activate $(CONDA_ENV) && flake8"
@bash -c "source $(ANACONDA_HOME)/bin/activate $(CONDA_ENV) && flake8"

## Sphinx targets

Expand Down
6 changes: 2 additions & 4 deletions hummingbird/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

"""Top-level package for Hummingbird."""

from .wsgi import application
from .__version__ import __author__, __email__, __version__

__author__ = """Carsten Ehbrecht"""
__email__ = 'ehbrecht@dkrz.de'
__version__ = '0.6.0'
from .wsgi import application
9 changes: 9 additions & 0 deletions hummingbird/__version__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# -*- coding: utf-8 -*-

# This information is located in its own file so that it can be loaded
# 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.6.0'
5 changes: 4 additions & 1 deletion hummingbird/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def run_process_action(action=None):
if action == 'stop':
os.remove(PID_FILE)
except IOError:
msg = "No PID file found. Service not running?"
msg = 'No PID file found. Service not running? Try "netstat -nlp | grep :5000".'
except psutil.NoSuchProcess as e:
msg = e.msg
click.echo(msg)
Expand Down Expand Up @@ -137,6 +137,9 @@ def start(config, bind_host, daemon, hostname, port,
"""Start PyWPS service.
This service is by default available at http://localhost:5000/wps
"""
if os.path.exists(PID_FILE):
click.echo('PID file exists: "{}". Service still running?'.format(PID_FILE))
os._exit(0)
cfgfiles = []
cfgfiles.append(write_user_config(
wps_hostname=hostname,
Expand Down
9 changes: 4 additions & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ tag = True
[metadata]
description-file = README.rst

[bumpversion:file:hummingbird/__init__.py]
[bumpversion:file:hummingbird/__version__.py]
search = __version__ = '{current_version}'
replace = __version__ = '{new_version}'

Expand All @@ -19,19 +19,19 @@ search = Version="{current_version}"
replace = Version="{new_version}"

[tool:pytest]
addopts =
addopts =
--strict
--tb=native
tests/
python_files = test_*.py
markers =
markers =
online: mark test to need internet connection
slow: mark test to be slow

[flake8]
ignore = F401,E402
max-line-length = 120
exclude =
exclude =
.git,
__pycache__,
docs/source/conf.py,
Expand All @@ -42,4 +42,3 @@ exclude =
[doc8]
ignore-path = docs/build,docs/source/_templates,docs/source/_static
max-line-length = 120

13 changes: 8 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@

from setuptools import setup, find_packages

version = __import__('hummingbird').__version__
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()

about = {}
with open(os.path.join(here, 'hummingbird', '__version__.py'), 'r') as f:
exec(f.read(), about)

reqs = [line.strip() for line in open('requirements.txt')]

classifiers = [
Expand All @@ -31,11 +34,11 @@
]

setup(name='hummingbird',
version=version,
version=about['__version__'],
description="A Web Processing Service for general tools used in the climate science community like cdo.",
long_description=README + '\n\n' + CHANGES,
author="Carsten Ehbrecht",
author_email='ehbrecht@dkrz.de',
author=about['__author__'],
author_email=about['__email__'],
url='https://github.com/bird-house/hummingbird',
classifiers=classifiers,
license="Apache Software License 2.0",
Expand All @@ -45,5 +48,5 @@
install_requires=reqs,
entry_points={
'console_scripts': [
'hummingbird=hummingbird.cli:cli',
'hummingbird=hummingbird.cli:cli',
]},)

0 comments on commit f05d230

Please sign in to comment.