diff --git a/.travis.yml b/.travis.yml index b3d77fca..c8edc1a4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,8 +18,7 @@ env: - PGPORT=5432 - UMAP_SETTINGS=umap/tests/settings.py install: -- pip install . -- pip install -r requirements-dev.txt +- make develop script: make test notifications: irc: diff --git a/Makefile b/Makefile index 61a540c2..163c20d5 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,7 @@ test: py.test -xv umap/tests/ develop: - python setup.py develop - pip install -r requirements-dev.txt + pip install -e .[test,dev] release: test compilemessages python setup.py sdist bdist_wheel test_publish: diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000..904a6da5 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,54 @@ +[metadata] +name = umap-project +version = 1.3.0.alpha +description = Create maps with OpenStreetMap layers in a minute and embed them in your site. +long_description = file: README.md +long_description_content_type = text/markdown +author = Yohan Boniface +homepage = https://github.com/umap-project/umap +keywords = django leaflet geodjango openstreetmap map +classifiers = + Development Status :: 4 - Beta + Intended Audience :: Developers + Operating System :: OS Independent + Topic :: Software Development :: Libraries :: Python Modules + Programming Language :: Python + Programming Language :: Python :: 3 :: Only + Programming Language :: Python :: 3.4 + Programming Language :: Python :: 3.5 + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 + +[options] +packages = find: +include_package_data = True +install_requires = + Django>=3.2.5 + django-agnocomplete==1.0.0 + django-compressor==2.4.1 + Pillow==8.3.2 + psycopg2==2.8.6 + requests==2.25.1 + social-auth-core==4.1.0 + social-auth-app-django==5.0.0 + +[options.extras_require] +dev = + black==21.10b0 + mkdocs==1.1.2 +test = + factory-boy==3.2.0 + pytest==6.2.4 + pytest-django==4.3.0 + + +[options.entry_points] +console_scripts = + umap = umap.bin:main + +[flake8] +# Black crazyness. +max-line-length = 88 diff --git a/setup.py b/setup.py index af288090..8bf1ba93 100644 --- a/setup.py +++ b/setup.py @@ -1,50 +1,2 @@ -#!/usr/bin/env python - -import io -from pathlib import Path - -from setuptools import setup, find_packages - -import umap - - -def is_pkg(line): - return line and not line.startswith(('--', 'git', '#')) - - -with io.open('requirements.txt', encoding='utf-8') as reqs: - install_requires = [l for l in reqs.read().split('\n') if is_pkg(l)] - -setup( - name="umap-project", - version=umap.__version__, - author=umap.__author__, - author_email=umap.__contact__, - description=umap.__doc__, - keywords="django leaflet geodjango openstreetmap map", - url=umap.__homepage__, - packages=find_packages(), - include_package_data=True, - platforms=["any"], - zip_safe=True, - long_description=Path('README.md').read_text(), - long_description_content_type='text/markdown', - install_requires=install_requires, - classifiers=[ - "Development Status :: 4 - Beta", - "Intended Audience :: Developers", - "Operating System :: OS Independent", - "Topic :: Software Development :: Libraries :: Python Modules", - "Programming Language :: Python", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.4", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - ], - entry_points={ - 'console_scripts': ['umap=umap.bin:main'], - }, - ) +from setuptools import setup +setup() diff --git a/umap/__init__.py b/umap/__init__.py index 14455300..046a98f3 100644 --- a/umap/__init__.py +++ b/umap/__init__.py @@ -1,7 +1,7 @@ -"Create maps with OpenStreetMap layers in a minute and embed them in your site." -VERSION = (1, 2, 3) - -__author__ = 'Yohan Boniface' -__contact__ = "ybon@openstreetmap.fr" -__homepage__ = "https://github.com/umap-project/umap" -__version__ = ".".join(map(str, VERSION)) +try: + import pkg_resources +except ImportError: # pragma: no cover + pass +else: + if __package__: + VERSION = pkg_resources.get_distribution("umap-project").version