Skip to content

Commit

Permalink
Fix failing tests (#254)
Browse files Browse the repository at this point in the history
* use --upgrade flag for pip when installing test requirements; add [complete] install option (fixes #253)
* clean up setup.py
* add [complete] install option
  • Loading branch information
ungarj committed Mar 17, 2020
1 parent bc64569 commit 849bd55
Show file tree
Hide file tree
Showing 4 changed files with 159 additions and 154 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ before_install:
- if [ $RASTERIO_VERSION == "latest" ]; then pip install rasterio --no-binary :all:; else pip install rasterio==$RASTERIO_VERSION --no-binary :all:; fi;
- export CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
install:
- pip install -e .[contours,s3,serve,vrt]
- pip install pytest coveralls pytest-cov pytest-flask rio-cogeo
- pip install -e .[complete]
- pip install --upgrade pytest coveralls pytest-cov pytest-flask rio-cogeo
script:
- pytest -v --cov mapchete test/
after_success:
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cachetools
cached_property
click>=7.0.0'
click>=7.1.1
click-plugins
click-spinner
fiona>=1.8b1
Expand Down
118 changes: 62 additions & 56 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,90 +1,96 @@
"""Install Mapchete."""

from setuptools import find_packages, setup
import os
from setuptools import find_packages, setup

# don't install dependencies when building win readthedocs
on_rtd = os.environ.get('READTHEDOCS') == 'True'
on_rtd = os.environ.get("READTHEDOCS") == "True"

# get version number
# from https://github.com/mapbox/rasterio/blob/master/setup.py#L55
with open('mapchete/__init__.py') as f:
with open("mapchete/__init__.py") as f:
for line in f:
if line.find("__version__") >= 0:
version = line.split("=")[1].strip()
version = version.strip('"')
version = version.strip("'")
continue
version = line.split("=")[1].strip().strip('"').strip("'")
break

# use README.rst for project long_description
with open('README.rst') as f:
with open("README.rst") as f:
readme = f.read()


def _parse_requirements(file):
return sorted(set(
line.partition('#')[0].strip()
line.partition("#")[0].strip()
for line in open(os.path.join(os.path.dirname(__file__), file))
) - set(''))
) - set(""))

# dependencies for extra features
req_contours = ["matplotlib"]
req_s3 = ["boto3"]
req_serve = ["flask"]
req_vrt = ["lxml"]
req_complete = req_contours + req_s3 + req_serve + req_vrt

setup(
name='mapchete',
name="mapchete",
version=version,
description='Tile-based geodata processing using rasterio & Fiona',
description="Tile-based geodata processing using rasterio & Fiona",
long_description=readme,
author='Joachim Ungar',
author_email='joachim.ungar@gmail.com',
url='https://github.com/ungarj/mapchete',
license='MIT',
author="Joachim Ungar",
author_email="joachim.ungar@gmail.com",
url="https://github.com/ungarj/mapchete",
license="MIT",
packages=find_packages(),
entry_points={
'console_scripts': [
'mapchete=mapchete.cli.main:main'
"console_scripts": [
"mapchete=mapchete.cli.main:main"
],
'mapchete.cli.commands': [
'convert=mapchete.cli.default.convert:convert',
'create=mapchete.cli.default.create:create',
'execute=mapchete.cli.default.execute:execute',
'formats=mapchete.cli.default.formats:formats',
'index=mapchete.cli.default.index:index',
'processes=mapchete.cli.default.processes:processes',
'serve=mapchete.cli.default.serve:serve',
"mapchete.cli.commands": [
"convert=mapchete.cli.default.convert:convert",
"create=mapchete.cli.default.create:create",
"execute=mapchete.cli.default.execute:execute",
"formats=mapchete.cli.default.formats:formats",
"index=mapchete.cli.default.index:index",
"processes=mapchete.cli.default.processes:processes",
"serve=mapchete.cli.default.serve:serve",
],
'mapchete.formats.drivers': [
'geojson=mapchete.formats.default.geojson',
'gtiff=mapchete.formats.default.gtiff',
'mapchete_input=mapchete.formats.default.mapchete_input',
'png_hillshade=mapchete.formats.default.png_hillshade',
'png=mapchete.formats.default.png',
'raster_file=mapchete.formats.default.raster_file',
'vector_file=mapchete.formats.default.vector_file',
'tile_directory=mapchete.formats.default.tile_directory'
"mapchete.formats.drivers": [
"geojson=mapchete.formats.default.geojson",
"gtiff=mapchete.formats.default.gtiff",
"mapchete_input=mapchete.formats.default.mapchete_input",
"png_hillshade=mapchete.formats.default.png_hillshade",
"png=mapchete.formats.default.png",
"raster_file=mapchete.formats.default.raster_file",
"vector_file=mapchete.formats.default.vector_file",
"tile_directory=mapchete.formats.default.tile_directory"
],
'mapchete.processes': [
'example_process=mapchete.processes.examples.example_process',
'contours=mapchete.processes.contours',
'convert=mapchete.processes.convert',
'hillshade=mapchete.processes.hillshade'
"mapchete.processes": [
"example_process=mapchete.processes.examples.example_process",
"contours=mapchete.processes.contours",
"convert=mapchete.processes.convert",
"hillshade=mapchete.processes.hillshade"
]
},
package_dir={'static': 'static'},
package_data={'mapchete.static': ['*']},
install_requires=_parse_requirements('requirements.txt') if not on_rtd else [],
package_dir={"static": "static"},
package_data={"mapchete.static": ["*"]},
install_requires=_parse_requirements("requirements.txt") if not on_rtd else [],
extras_require={
'contours': ['matplotlib'],
's3': ['boto3'],
'serve': ['flask'],
'vrt': ['lxml']
"complete": req_complete,
"contours": req_contours,
"s3": req_s3,
"serve": req_serve,
"vrt": req_vrt,
},
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Topic :: Scientific/Engineering :: GIS',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Topic :: Scientific/Engineering :: GIS",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
],
setup_requires=['pytest-runner'],
tests_require=['pytest', 'pytest-flask', 'rio-cogeo']
setup_requires=["pytest-runner"],
tests_require=["pytest", "pytest-flask", "rio-cogeo"]
)
Loading

0 comments on commit 849bd55

Please sign in to comment.