Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.9"
python-version: "3.10"
- name: Install tox
run: |
pip install tox>=4.0
Expand All @@ -33,12 +33,14 @@ jobs:
strategy:
matrix:
include:
- tox-env: py39-extra
python-version: "3.9"
- tox-env: py310-extra
python-version: "3.10"
- tox-env: py311-extra
python-version: "3.11"
- tox-env: py312-extra
python-version: "3.12"
- tox-env: py313-extra
python-version: "3.13"
steps:
- uses: actions/checkout@v4
- name: Install packages 📦
Expand All @@ -54,7 +56,7 @@ jobs:
- name: Run tests with tox ⚙️
run: tox -e ${{ matrix.tox-env }}
- name: Run coveralls ⚙️
if: matrix.python-version == 3.9
if: matrix.python-version == 3.10
uses: AndreMiras/coveralls-python-action@develop

docs:
Expand All @@ -64,9 +66,9 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Setup Python 3.9
name: Setup Python 3.10
with:
python-version: 3.9
python-version: "3.10"
- name: Build documentation 🏗️
run: |
pip install -e .[dev]
Expand Down
44 changes: 0 additions & 44 deletions INSTALL.md

This file was deleted.

104 changes: 104 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Configuration
APP_ROOT := $(abspath $(lastword $(MAKEFILE_LIST))/..)

# end of configuration

define PRINT_HELP_PYSCRIPT
import re, sys

for line in sys.stdin:
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
if match:
target, help = match.groups()
print("%-20s %s" % (target, help))
else:
match = re.match(r'^## (.*)$$', line)
if match:
help = match.groups()[0]
print("\n%s" % (help))
endef
export PRINT_HELP_PYSCRIPT

.DEFAULT_GOAL := help

help: ## print this help message. (Default)
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)

## Build targets:

install: ## install pywps
@echo "Installing pywps ..."
@-bash -c 'pip install -e .'

develop: ## install pywps with development libraries
@echo "Installing development requirements for tests and docs ..."
@-bash -c 'pip install -e ".[dev]"'

clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts

clean-build: ## remove build artifacts
@echo "Removing build artifacts ..."
@-rm -fr build/
@-rm -fr dist/
@-rm -fr .eggs/
@-find . -name '*.egg-info' -exec rm -fr {} +
@-find . -name '*.egg' -exec rm -f {} +
@-find . -name '*.log' -exec rm -fr {} +
@-find . -name '*.sqlite' -exec rm -fr {} +

clean-pyc: ## remove Python file artifacts
@echo "Removing Python file artifacts ..."
@-find . -name '*.pyc' -exec rm -f {} +
@-find . -name '*.pyo' -exec rm -f {} +
@-find . -name '*~' -exec rm -f {} +
@-find . -name '__pycache__' -exec rm -fr {} +

clean-test: ## remove test and coverage artifacts
@echo "Removing test artifacts ..."
@-rm -fr .tox/
@-rm -f .coverage
@-rm -fr .pytest_cache

clean-dist: clean ## remove git ignored files and directories
@echo "Running 'git clean' ..."
@git diff --quiet HEAD || echo "There are uncommitted changes! Aborting 'git clean' ..."
## do not use git clean -e/--exclude here, add them to .gitignore instead
@-git clean -dfx

clean-docs: ## remove documentation artifacts
@echo "Removing documentation artifacts ..."
$(MAKE) -C docs clean

lint: ## check style with ruff
@echo "Running code style checks ..."
@bash -c 'ruff check pywps'

## Testing targets:

test: ## run tests quickly with the default Python (skip slow and online tests)
@echo "Running tests (skip slow and online tests) ..."
@bash -c 'pytest -v -m "not slow and not online" tests/'

test-all: ## run all tests quickly with the default Python
@echo "Running all tests (including slow and online tests) ..."
@bash -c 'pytest -v tests/'

## Sphinx targets:

docs: clean-docs ## generate Sphinx HTML documentation, including API docs
@echo "Generating docs with Sphinx ..."
$(MAKE) -C docs html
@echo "Open your browser to: file:/$(APP_ROOT)/docs/build/html/index.html"
## do not execute xdg-open automatically since it hangs ReadTheDocs and job does not complete
@echo "xdg-open $(APP_ROOT)/docs/build/html/index.html"


## Deployment targets:

# dist: clean ## builds source and wheel package
# python -m flit build
# ls -l dist

# release: dist ## package and upload a release
# python -m flit publish dist/*

54 changes: 47 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,31 @@ the Open Geospatial Consortium. PyWPS is written in Python.
[![Build Status](https://github.com/geopython/pywps/actions/workflows/main.yml/badge.svg)](https://github.com/geopython/pywps/actions/workflows/main.yml)
[![Coverage Status](https://coveralls.io/repos/github/geopython/pywps/badge.svg?branch=main)](https://coveralls.io/github/geopython/pywps?branch=main)
[![PyPI](https://img.shields.io/pypi/dm/pywps.svg)](https://pypi.org/project/pywps/)
[![Conda](https://anaconda.org/conda-forge/pywps/badges/version.svg)](https://anaconda.org/channels/conda-forge/packages/pywps/overview)
[![GitHub license](https://img.shields.io/github/license/geopython/pywps.svg)]()

[![Join the chat at https://gitter.im/geopython/pywps](https://badges.gitter.im/geopython/pywps.svg)](https://gitter.im/geopython/pywps?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

# License
## License

As of PyWPS 4.0.0, PyWPS is released under an
[MIT](https://en.wikipedia.org/wiki/MIT_License) license
(see [LICENSE.txt](LICENSE.txt)).

# Dependencies
## Dependencies

See [requirements.txt](requirements.txt) file

# Run tests
## Install

Install it from GitHub:
```bash
$ git clone https://github.com/geopython/pywps.git
$ cd pywps/
$ pip install .
```

## Run tests

```bash
pip install -r requirements-dev.txt
Expand All @@ -32,9 +42,37 @@ python -m coverage run --source=pywps -m unittest tests
python -m coverage report -m
```

# Run web application
## Quick Guide with Conda

## Example service
Checkout source from GitHub:
```bash
$ git clone https://github.com/geopython/pywps.git
$ cd pywps/
```

Build conda environment:
```bash
conda env create -f environment.yml
```

Install pywps:
```bash
make install
```

Or the development version:
```bash
make develop
```

Run tests:
```bash
make tests
```

## Run web application

### Example service

Clone the example service after having installed PyWPS:

Expand All @@ -44,7 +82,9 @@ cd pywps-flask
python demo.py
```

## Apache configuration
Access example service: http://localhost:5000

### Apache configuration

1. Enable WSGI extension

Expand Down Expand Up @@ -92,7 +132,7 @@ python demo.py
```


# Issues
## Issues

On Windows PyWPS does not support multiprocessing which is used when making
requests storing the response document and updating the status to displaying
Expand Down
23 changes: 23 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: pywps
channels:
- conda-forge
dependencies:
- python >=3.10,<3.14
- pip >=25.0
- owslib >=0.35.0
- requests >=2.32.5
- werkzeug >=3.1.4
- sqlalchemy >=2.0.44
- lxml >=6.0.2
- urllib3 >=2.5.0
- markupsafe >=3.0.3
- numpy >=1.22.2
- zarr <3
- fiona
- geotiff
# tests
- pytest
- ruff >=0.5.7
# docs
- sphinx >=7.0.0

8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[tool.ruff]
lint.select = ["E", "W", "F", "C90"] # Flake8-equivalent rule families
lint.ignore = ["F401", "E402", "C901"]

line-length = 120
exclude = ["tests"]

4 changes: 2 additions & 2 deletions pywps/validator/complexvalidator.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def validategeojson(data_input, mode):
>>> from io import StringIO
>>> class FakeInput(object):
... json = open('point.geojson','w')
... json.write('''{"type":"Feature", "properties":{}, "geometry":{"type":"Point", "coordinates":[8.5781228542328, 22.87500500679]}, "crs":{"type":"name", "properties":{"name":"urn:ogc:def:crs:OGC:1.3:CRS84"}}}''') # noqa
... json.write('''{"type":"Feature", "properties":{}, "geometry":{"type":"Point", "coordinates":[8.5781228542328, 22.87500500679]}, "crs":{"type":"name", "properties":{"name":"urn:ogc:def:crs:OGC:1.3:CRS84"}}}''')
... json.close()
... file = 'point.geojson'
>>> class FakeDataFormat(object):
Expand All @@ -232,7 +232,7 @@ def validategeojson(data_input, mode):
>>> fake_input.data_format = FakeDataFormat()
>>> validategeojson(fake_input, MODE.SIMPLE)
True
"""
""" # noqa

LOGGER.info('validating GeoJSON; Mode: {}'.format(mode))
passed = False
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ bump2version
coverage
coveralls
docutils
flake8
ruff
pylint
pytest
pytest-cov
Expand Down
7 changes: 0 additions & 7 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,4 @@ replace = {new_version}
[coverage:run]
relative_files = True

[flake8]
ignore =
F401
E402
W606
max-line-length = 120
exclude = tests

5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,17 @@
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering :: GIS",
],
"install_requires": INSTALL_REQUIRES,
"extras_require": dict(
dev=DEV_REQUIRES,
),
"python_requires": ">=3.9,<4",
"python_requires": ">=3.10,<4",
"packages": find_packages(exclude=["docs", "tests.*", "tests"]),
"include_package_data": True,
"scripts": [],
Expand Down
Loading