Commit 75631026 authored by Felix Delattre's avatar Felix Delattre
Browse files

Added basic project structure and CI

parent a5e91bd0
Pipeline #25625 canceled with stage
in 7 seconds
*.pyc
*.log
*.pkl
*.egg-info
Pipfile
Pipfile.lock
__pycache__
.pytest_cache
.cache
.vscode
.idea
build
dist
venv
image: python:3-buster
# Make pip cache the installed dependencies
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
cache:
paths:
- .cache/pip
- venv/
stages:
- test
before_script:
- python3 -V
- pip3 install virtualenv --quiet
- virtualenv venv --quiet
- source venv/bin/activate
- pip3 install . --quiet
- pip3 install .[tests] --quiet
linters:
stage: test
interruptible: true
script:
- pip3 install .[linters] --quiet
- make check
tests:
stage: test
interruptible: true
script:
- pytest tests
fail_fast: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: check-builtin-literals
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 20.8b1
hooks:
- id: black
args: [ --line-length=96 ]
- repo: https://github.com/pycqa/flake8
rev: 3.7.9
hooks:
- id: flake8
args: [ --max-line-length=96 ]
- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
language: system
args: [ --disable=E0611, -E, -j4 ]
types: [ python ]
check:
pre-commit run --all-files
install:
pip install .[tests]
pip install .[linters]
pip install -e .
pre-commit install
format:
pre-commit run --all-files black
clean:
rm -r -f docs/build
========================
openbuildingmap-data-api
========================
===============================
OpenBuildingMap Data API Server
===============================
|Build status|
.. |Build status| image:: https://git.gfz-potsdam.de/dynamicexposure/openbuildingmap/data-api-server/badges/master/pipeline.svg
:target: https://git.gfz-potsdam.de/dynamicexposure/openbuildingmap/data-api-server/-/commits/master
Idea
----
Provide an API for data access around the OpenBuildingMap.
Requirements
------------
* python >= 3.7
Installation
------------
pip3 install .
Contributing
------------
Development and linting dependencies can be installed with:
pip3 install .[tests]
pip3 install .[linters]
We use `black` and `flake8` for consistent code style and `pylint` for general linting. Project linting comes pre-defined in `.pre-commit` to be used in `https://pre-commit.com/`_.
pre-commit install
Copyright and copyleft
----------------------
......
#!/usr/bin/env python3
# Copyright (C) 2021:
# Helmholtz-Zentrum Potsdam Deutsches GeoForschungsZentrum GFZ
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
# General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
import logging
import sys
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
logger.addHandler(logging.StreamHandler(sys.stdout))
def main():
logger.info("obmapidata has started")
sys.exit()
if __name__ == "__main__":
main()
#!/usr/bin/env python3
# Copyright (c) 2021
#
# * Helmholtz-Zentrum Potsdam Deutsches GeoForschungsZentrum GFZ
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from setuptools import setup, find_packages
tests_require = [
"pytest",
]
linters_require = ["pre-commit", "pylint"]
setup(
name="obmdataapi",
version="0.0.1",
description="OpenBuildingMap Data API Server",
long_description="Provide an API for data access around the OpenBuildingMap.",
url="https://git.gfz-potsdam.de/dynamicexposure/openbuildingmap/data-api-server",
license="AGPLv3+",
keywords="API",
author="Helmholtz-Zentrum Potsdam Deutsches GeoForschungsZentrum GFZ",
tests_require=tests_require,
extras_require={
"tests": tests_require,
"linters": linters_require,
},
packages=find_packages(),
include_package_data=True,
python_requires=">=3.7",
)
#!/usr/bin/env python3
# Copyright (C) 2021:
# Helmholtz-Zentrum Potsdam Deutsches GeoForschungsZentrum GFZ
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
# General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#!/usr/bin/env python3
# Copyright (C) 2021:
# Helmholtz-Zentrum Potsdam Deutsches GeoForschungsZentrum GFZ
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
# General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
import logging
logger = logging.getLogger()
def test_func():
pass
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment