diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..7ed76ca3 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,60 @@ +name: Test Python package + +on: [push] + +jobs: + test: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [2.7, 3.6, 3.7, 3.8, 3.9] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install project and dependencies + run: | + python -m pip install --upgrade pip + if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi + pip install . + - name: Lint with flake8 + run: | + flake8 mappyfile --max-line-length=120 + flake8 --ignore=E501,E121,E122,E123,E126,E127,E128 tests --exclude=*/basemaps/*,*/ms-ogc-workshop/* + - name: Test with pytest + run: | + pytest --ignore=tests/mapfiles --cov mappyfile --cov-report xml docs/examples/api/ misc/ tests/ + # https://pytest-cov.readthedocs.io/en/latest/reporting.html + - name: Command line tests + run: | + mappyfile schema mapfile-schema.json + mappyfile schema mapfile-schema-7-6.json --version=7.6 + mappyfile validate tests/sample_maps/256_overlay_res.map + mappyfile format tests/sample_maps/256_overlay_res.map tests/sample_maps/256_overlay_res_formatted.map + - name: Upload coverage data to coveralls.io + run: coveralls --service=github + if: ${{ matrix.python-version != 2.7 }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COVERALLS_FLAG_NAME: ${{ matrix.test-name }} + COVERALLS_PARALLEL: true + + # see https://github.com/marketplace/actions/coveralls-github-action + # we can't use coveralls-github-action as it doesn't support xml output + # see https://coveralls-python.readthedocs.io/en/latest/usage/configuration.html#github-actions-support + coveralls: + name: Indicate completion to coveralls.io + needs: test + runs-on: ubuntu-latest + container: python:3-slim + steps: + - name: Finished + run: | + pip3 install --upgrade coveralls + coveralls --service=github --finish + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.readthedocs.yml b/.readthedocs.yml index b537fd71..89601c8d 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,8 +1,22 @@ -# see http://docs.readthedocs.io/en/latest/yaml-config.html +# .readthedocs.yaml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details +# Required +version: 2 + +# Set the version of Python and other tools you might need build: - image: latest + os: ubuntu-20.04 + tools: + python: "3.9" + +# Build documentation in the docs/ directory with Sphinx +sphinx: + configuration: docs/conf.py +# Optionally declare the Python requirements required to build your docs python: - version: 3.6 - setup_py_install: true \ No newline at end of file + install: + - method: pip + path: . diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 651581ef..00000000 --- a/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -dist: bionic -sudo: false -language: python -python: - - "2.7" - - "3.6" - - "3.7" - - "3.8" - - "pypy3" -install: - - pip install tox-travis coveralls -script: - - tox - - python setup.py install - - mappyfile schema mapfile-schema.json - - mappyfile schema mapfile-schema-7-6.json --version=7.6 - - mappyfile validate tests/sample_maps/256_overlay_res.map - - mappyfile format tests/sample_maps/256_overlay_res.map tests/sample_maps/256_overlay_res_formatted.map - -after_success: - - coveralls \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index 4841374d..ceb67112 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -22,16 +22,17 @@ install: - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" - "python -m pip install --upgrade pip" - "pip install -r requirements-dev.txt" - - "python setup.py install" + - pip install . build_script: - pip install -U setuptools - pip install wheel - - python setup.py bdist_wheel --universal - - python setup.py sdist + - pip install build + - python -m build --wheel + - python -m build --sdist test_script: - - pytest + - python -m pytest # for unknown reason running pytest directly fails on Python 3.7 and above - "flake8 --ignore=E501,E121,E122,E123,E126,E127,E128 tests --exclude=*/basemaps/*,*/ms-ogc-workshop/*" - flake8 mappyfile --max-line-length=120 - mappyfile schema mapfile-schema.json @@ -40,17 +41,21 @@ test_script: - mappyfile format tests/sample_maps/256_overlay_res.map tests/sample_maps/256_overlay_res_formatted.map deploy: - provider: GitHub - auth_token: - secure: 1FJ9ZyG2q5HxxYFSdC6HUA8+mjE9dKd55qPc6i2NZCRaOSDVog0tsoclT3e7N1sG - draft: true - on: - branch: master # release from master branch only - APPVEYOR_REPO_TAG: true # deploy on tag push only + - provider: GitHub + auth_token: + secure: 1FJ9ZyG2q5HxxYFSdC6HUA8+mjE9dKd55qPc6i2NZCRaOSDVog0tsoclT3e7N1sG + draft: true + on: + branch: master # release from master branch only + APPVEYOR_REPO_TAG: true # deploy on tag push only artifacts: - path: 'dist\*.whl' name: wheel deploy_script: - - ps: if (($env:APPVEYOR_REPO_TAG -eq $TRUE) -and ($Env:PYTHON -ne "C:\\Python27-x64")) { pip install -qq twine; twine upload --skip-existing dist/* } \ No newline at end of file + - ps: if (($env:APPVEYOR_REPO_TAG -eq $TRUE) -and ($Env:PYTHON -ne "C:\\Python27-x64")) { pip install -qq twine; twine upload --skip-existing dist/* } + +# Uncomment to enable debugging on the server +#on_finish: +# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) diff --git a/mappyfile.pyproj b/mappyfile.pyproj index cdd57e35..5e9ea98f 100644 --- a/mappyfile.pyproj +++ b/mappyfile.pyproj @@ -31,6 +31,8 @@ PROJ_LIB=C:\MapServer\bin\proj\SHARE 10.0 + + @@ -112,6 +114,8 @@ PROJ_LIB=C:\MapServer\bin\proj\SHARE + + diff --git a/setup.cfg b/setup.cfg index a15e82e0..d12c7646 100644 --- a/setup.cfg +++ b/setup.cfg @@ -5,5 +5,5 @@ zip_safe= universal = 1 [metadata] -description-file = README.rst +description_file = README.rst license_file = LICENSE \ No newline at end of file diff --git a/tox.ini b/tox.ini index 6aeb5eda..052298ef 100644 --- a/tox.ini +++ b/tox.ini @@ -7,6 +7,6 @@ envlist = py27,py35,py36,py37,py38,pypy,pypy35 usedevelop = true deps=-rrequirements-dev.txt commands= - py.test --ignore=tests/mapfiles --cov mappyfile --cov-report term-missing docs/examples/api/ misc/ tests/ + pytest --ignore=tests/mapfiles --cov mappyfile --cov-report term-missing docs/examples/api/ misc/ tests/ flake8 mappyfile --max-line-length=120 flake8 --ignore=E501,E121,E122,E123,E126,E127,E128 tests --exclude=*/basemaps/*,*/ms-ogc-workshop/*