Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
vvmruder committed May 30, 2023
0 parents commit 89f9484
Show file tree
Hide file tree
Showing 44 changed files with 34,961 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[run]
omit =
geolink2oereb/tests/*
3 changes: 3 additions & 0 deletions .git-attributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* text whitespace=trailing-space,tab-in-indent,cr-at-eol,tabwidth=4,blank-at-eof eol=lf
.gitmodules text whitespace=indent-with-non-tab
Makefile text whitespace=indent-with-non-tab
114 changes: 114 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name: CI/CD

on: push

jobs:

test:
name: Test Python
runs-on: ubuntu-22.04
strategy:
matrix:
python-version:
- '3.10'
- '3.11'
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Run checks for Python ${{ matrix.python-version }}
env:
CI: true
run: |
python -V
pip install -r requirements.txt
git --no-pager diff --check `git log --oneline | tail -1 | cut --fields=1 --delimiter=' '`
flake8
py.test -vv --cov-config .coveragerc --cov geolink2oereb tests
- name: Send coverage
run: |
bash <(curl -s https://codecov.io/bash)
deploy-dev:
name: Deploy to PyPI Test
needs:
- test
if: ${{ github.ref == 'refs/heads/master' }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
- name: Build packages
run: |
pip install wheel -r requirements.txt
sed -i "s/\(version='[0-9]*\.[0-9]*\.[0-9]*\)\('\)/\1.dev$(date +%Y%m%d%H%M%S)\2/g" setup.py
sed -i "s/5 - Production\/Stable/4 - Beta/g" setup.py
python setup.py clean check sdist bdist_wheel
- name: Upload to PyPI Test
uses: pypa/[email protected]
with:
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/

deploy-tag:
name: Deploy to PyPI
needs:
- test
if: ${{ startsWith(github.ref, 'refs/tags') }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
- name: Build packages
run: |
pip install wheel -r requirements.txt
python setup.py clean check sdist bdist_wheel
- name: Upload to PyPI
uses: pypa/[email protected]
with:
password: ${{ secrets.PYPI_TOKEN }}

build-doc:
name: Build docs for each version
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Build docs
run: |
python -V
pip install -r requirements.txt
sphinx-build -b html doc/source/ doc/build/html/
touch doc/build/html/.nojekyll
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: docs
path: doc/build/html/
retention-days: 1

deploy-doc:
name: Deploy docs to GitHub Pages
needs:
- build-doc
if: ${{ startsWith(github.ref, 'refs/tags') }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: docs
- name: Deploy
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: doc/build/html
46 changes: 46 additions & 0 deletions .github/workflows/codacy-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# This workflow checks out code, performs a Codacy security scan
# and integrates the results with the
# GitHub Advanced Security code scanning feature. For more information on
# the Codacy security scan action usage and parameters, see
# https://github.com/codacy/codacy-analysis-cli-action.
# For more information on Codacy Analysis CLI in general, see
# https://github.com/codacy/codacy-analysis-cli.

name: Codacy Security Scan

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
codacy-security-scan:
name: Codacy Security Scan
runs-on: ubuntu-latest
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout code
uses: actions/checkout@v3

# Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
- name: Run Codacy Analysis CLI
uses: codacy/[email protected]
with:
# Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository
# You can also omit the token and run the tools that support default configurations
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
verbose: true
output: results.sarif
format: sarif
# Adjust severity of non-security issues
gh-code-scanning-compat: true
# Force 0 exit code to allow SARIF file generation
# This will handover control about PR rejection to the GitHub side
max-allowed-issues: 2147483647

# Upload the SARIF file generated in the previous step
- name: Upload SARIF results file
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: results.sarif
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/.idea/
/.venv/
/.coverage
/.coverage.*
/.cache/
/.tox/
/.pytest_cache/
/build/
/dist/
/doc/build/
/geolink2oereb.egg-info/
__pycache__
*.pyc
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Changelog

## 1.0.0

Supported GEO-Link API version: 20170214 (v1.0.0)

- Initial version
25 changes: 25 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
BSD 2-Clause License

Copyright (c) 2023, RUDERT-GEOINFORMATIK
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4 changes: 4 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include README.rst
include CHANGELOG
include setup.cfg
recursive-exclude tests *.*
48 changes: 48 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
.venv/venv.timestamp:
python3 -m venv .venv
.venv/bin/pip install wheel
touch $@


.venv/requirements.timestamp: .venv/venv.timestamp setup.py requirements.txt
.venv/bin/pip install --upgrade -r requirements.txt
touch $@


.PHONY: git-attributes
git-attributes:
git --no-pager diff --check `git log --oneline | tail -1 | cut --fields=1 --delimiter=' '`


.PHONY: lint
lint: .venv/requirements.timestamp
.venv/bin/flake8


.PHONY: test
test: .venv/requirements.timestamp
.venv/bin/py.test -vv --cov=geolink2oereb --cov-report term-missing:skip-covered tests


.PHONY: check
check: git-attributes lint test


.PHONY: clean
clean:
rm -rf .venv


.PHONY: build
build: .venv/requirements.timestamp
.venv/bin/python setup.py clean sdist bdist_wheel


.PHONY: deploy
deploy: .venv/requirements.timestamp
.venv/bin/python setup.py clean sdist bdist_wheel upload


.PHONY: doc
doc: .venv/requirements.timestamp
.venv/bin/sphinx-build -b html doc/source/ doc/build/html/
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
OEREBlex geoLink Formatter
==========================

|license| |python version| |format| |status| |build status| |coverage report| |dependencies| |code quality|

This is a small library, meant to be used in combination with OEREBlex. It is capable of parsing a received
geoLink response (XML) and converting it to multiple formats, such as HTML, which can be styled for
presentation.

For detailed information, please refer to the online documentation:

https://openoereb.github.io/geolink2oereb/

.. |license| image:: https://img.shields.io/pypi/l/geolink2oereb.svg
:target: https://pypi.org/project/geolink2oereb/
.. |python version| image:: https://img.shields.io/pypi/pyversions/geolink2oereb.svg
:target: https://pypi.org/project/geolink2oereb/
.. |format| image:: https://img.shields.io/pypi/format/geolink2oereb.svg
:target: https://pypi.org/project/geolink2oereb/
.. |status| image:: https://img.shields.io/pypi/status/geolink2oereb.svg
:target: https://pypi.org/project/geolink2oereb/
.. |build status| image:: https://travis-ci.org/openoereb/geolink2oereb.svg?branch=master
:target: https://travis-ci.org/openoereb/geolink2oereb
.. |coverage report| image:: https://codecov.io/gh/openoereb/geolink2oereb/branch/master/graph/badge.svg
:target: https://codecov.io/gh/openoereb/geolink2oereb
.. |dependencies| image:: https://img.shields.io/librariesio/github/openoereb/geolink2oereb.svg
:target: https://libraries.io/github/openoereb/geolink2oereb
.. |code quality| image:: https://api.codacy.com/project/badge/Grade/d2bb03f17bf3438cb295c0b5ea131ac8
:target: https://www.codacy.com/app/openoereb/geolink2oereb?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=openoereb/geolink2oereb&amp;utm_campaign=Badge_Grade
3 changes: 3 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
comment:
layout: "diff"
behavior: default
Loading

0 comments on commit 89f9484

Please sign in to comment.