Fix GitHub Actions configuration; change setup.

This commit is contained in:
Sergey Vartanov 2021-09-02 04:23:11 +03:00
parent ba26c1d4d7
commit 9dcd9f2e60
6 changed files with 29 additions and 18 deletions

View file

@ -21,18 +21,18 @@ jobs:
pip install black flake8 pytest pip install black flake8 pytest
pip install -r requirements.txt pip install -r requirements.txt
pip install . pip install .
- name: Test with pytest - name: Check code style with Black
run: | run: |
pytest -v black -l 80 --check roentgen tests
- name: Lint with Flake8 - name: Lint with Flake8
run: | run: |
flake8 --max-line-length=80 --ignore=E203,W503 flake8 --max-line-length=80 --ignore=E203,W503
- name: Check code style with Black - name: Test with pytest
run: | run: |
black -l 80 --check roentgen test roentgen.py pytest -v
- name: Test render - name: Test render
run: | run: |
roentgen render -b 10.000,20.000,10.001,20.001 --cache test/data roentgen render -b 10.000,20.000,10.001,20.001 --cache tests/data
- name: Test icon generation - name: Test icon generation
run: | run: |
roentgen icons roentgen icons
@ -44,4 +44,4 @@ jobs:
roentgen element --node amenity=bench,material=wood roentgen element --node amenity=bench,material=wood
- name: Test tile generation - name: Test tile generation
run: | run: |
roentgen tile --coordinates 50.000,40.000 --cache test/data roentgen tile --coordinates 50.000,40.000 --cache tests/data

3
.gitignore vendored
View file

@ -1,10 +1,11 @@
# Generated files # Generated files
out/ dist/
doc/*.html doc/*.html
doc/*.svg doc/*.svg
doc/*.wiki doc/*.wiki
missed_tags.yml missed_tags.yml
out/
# Cache # Cache

View file

@ -1,8 +1,8 @@
#!/bin/sh #!/bin/sh
echo "Checking code format with Black..." echo "Checking code format with Black..."
if ! black -l 80 --check tests roentgen roentgen.py; then if ! black -l 80 --check tests roentgen; then
black -l 80 --diff tests roentgen roentgen.py black -l 80 --diff tests roentgen
echo "FAIL" echo "FAIL"
exit 1 exit 1
fi fi

View file

@ -10,8 +10,8 @@ else
fi fi
echo "Checking code format with Black..." echo "Checking code format with Black..."
if ! black -l 80 --check tests roentgen roentgen.py; then if ! black -l 80 --check tests roentgen; then
black -l 80 --diff tests roentgen roentgen.py black -l 80 --diff tests roentgen
echo "FAIL" echo "FAIL"
exit 1 exit 1
fi fi
@ -33,22 +33,22 @@ pytest -v || { echo "FAIL"; exit 1; }
# Integration tests. # Integration tests.
echo "Test render" echo "Test render"
python3 roentgen.py render -b 10.000,20.000,10.001,20.001 --cache tests/data \ python3 roentgen render -b 10.000,20.000,10.001,20.001 --cache tests/data \
|| { echo "FAIL"; exit 1; } || { echo "FAIL"; exit 1; }
grep "natural: tree" out/map.svg || { echo "FAIL"; exit 1; } grep "natural: tree" out/map.svg || { echo "FAIL"; exit 1; }
echo "Test icons" echo "Test icons"
python3 roentgen.py icons || { echo "FAIL"; exit 1; } python3 roentgen icons || { echo "FAIL"; exit 1; }
echo "Test MapCSS generation" echo "Test MapCSS generation"
python3 roentgen.py mapcss || { echo "FAIL"; exit 1; } python3 roentgen mapcss || { echo "FAIL"; exit 1; }
echo "Test element generation" echo "Test element generation"
python3 roentgen.py element --node amenity=bench,material=wood \ python3 roentgen element --node amenity=bench,material=wood \
|| { echo "FAIL"; exit 1; } || { echo "FAIL"; exit 1; }
echo "Test tile generation" echo "Test tile generation"
python3 roentgen.py tile --coordinates 50.000,40.000 --cache tests/data \ python3 roentgen tile --coordinates 50.000,40.000 --cache tests/data \
|| { echo "FAIL"; exit 1; } || { echo "FAIL"; exit 1; }
exit 0 exit 0

View file

@ -3,6 +3,5 @@ Röntgen entry point.
""" """
from roentgen.main import main from roentgen.main import main
if __name__ == "__main__": if __name__ == "__main__":
main() main()

View file

@ -5,13 +5,24 @@ from setuptools import setup
setup( setup(
name="roentgen-map", name="roentgen-map",
version="0.1", version="0.1.0",
packages=["roentgen"], packages=["roentgen"],
url="https://github.com/enzet/Roentgen", url="https://github.com/enzet/Roentgen",
project_urls={
"Bug Tracker": "https://github.com/enzet/Roentgen/issues",
},
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
license="MIT", license="MIT",
author="Sergey Vartanov", author="Sergey Vartanov",
author_email="me@enzet.ru", author_email="me@enzet.ru",
description="Python renderer for OpenStreetMap with custom icon set", description="Python renderer for OpenStreetMap with custom icon set",
long_description="Röntgen is a Python OpenStreetMap renderer and tile "
"generator with a custom set of CC-BY 4.0 icons aimed to display as many "
"map features as possible.",
entry_points={ entry_points={
"console_scripts": ["roentgen=roentgen.main:main"], "console_scripts": ["roentgen=roentgen.main:main"],
}, },