Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: generated python-sdk #94

Open
wants to merge 38 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
33d4b0f
feat: add deprecation warnings to old python sdk
jarinox Feb 19, 2024
e86389b
feat: add generated sdk
jarinox Feb 19, 2024
959bcb0
feat: adapt test workflow for generated client
jarinox Feb 19, 2024
7827c15
feat: regenerate using latest v7.1.1 docs
Mar 11, 2024
1a61040
feat: remove unused schemas
Mar 11, 2024
c8f343f
feat: remove InlineResponse classes
Mar 11, 2024
643c790
test: update tests to not use InlineResponse classes
Mar 11, 2024
337ac14
feat: add apiClient utility function
Mar 15, 2024
f1033fd
refactor: use apiClient method to configure client
Mar 15, 2024
10cc5cb
feat: make apiKey optional in apiClient helper
Mar 18, 2024
a49120a
refactor: examples to use most recent client
Mar 19, 2024
62cf6cb
Generated update. Please review before merging.
Mar 19, 2024
07a851e
Generated update. Please review before merging.
Mar 19, 2024
bfcd509
refactor: add newline to trigger ci/cd
Mar 19, 2024
ffda12a
feat: add newline to pyproject.toml
Mar 19, 2024
c64c697
feat: Integrate poetry into the pyproject.toml
MichaelsJP Mar 19, 2024
e953b33
ci: Adjust the tox and the ci tests to use poetry
MichaelsJP Mar 19, 2024
1297a98
fix: Fix wrong python version identifier
MichaelsJP Mar 19, 2024
a06b996
chore: Update to latest ubuntu image
MichaelsJP Mar 19, 2024
76b54e5
chore: Remove python 3.7
MichaelsJP Mar 19, 2024
e0a863e
fix: Add pytet to allowlist
MichaelsJP Mar 19, 2024
7742aa3
chore: Remove old test requirements
MichaelsJP Mar 19, 2024
f15d6fe
ci: Adjust the production pipeline
MichaelsJP Mar 19, 2024
56ec363
chore: Remove unneeded files
MichaelsJP Mar 19, 2024
78c4e08
chore: Remove double checkout action
MichaelsJP Mar 19, 2024
8c7d8dd
feat: workflow for deploying to testpypi
Mar 26, 2024
88e7ca9
build: rebuild client using latest templates
Mar 26, 2024
d5a7be0
test: deploy on testpypi on every commit
Apr 2, 2024
c01eb66
Generated update. Please review before merging.
Apr 5, 2024
d52eecf
Generated update. Please review before merging.
Apr 5, 2024
d912f54
Generated update. Please review before merging.
Apr 5, 2024
f3f2c9c
Generated update. Please review before merging.
Apr 8, 2024
67b4a53
Generated update. Please review before merging.
Apr 10, 2024
8d52e26
Generated update. Please review before merging.
Apr 10, 2024
5f9ddd6
Generated update. Please review before merging.
Apr 10, 2024
a094f7d
Generated update for version 8.0.1. Please review before merging.
Jun 7, 2024
faa4f44
Generated update for version 8.1.0. Please review before merging.
Jul 18, 2024
1d50279
Generated update for version 8.2.0. Please review before merging.
Dec 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 35 additions & 40 deletions .github/workflows/ci-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,60 +14,55 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11", "pypy3.8", "pypy3.9" ]
poetry-version: [ "latest" ]
os: [ ubuntu-20.04, macos-latest, windows-latest ]
config:
- python-version: '3.11'
tox: py311
poetry-version: [ "1.8.2" ]
os: [ ubuntu-22.04, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
name: Python ${{ matrix.python-version }} / Poetry ${{ matrix.poetry-version }} / ${{ matrix.os }}
name: Python ${{ matrix.config.python-version }} / Poetry ${{ matrix.poetry-version }} / ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- name: Install poetry
run: pipx install poetry
- name: Install Python ${{ matrix.config.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Update pip
run: |
python -m pip install --upgrade pip
- name: Run Poetry action
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ matrix.poetry-version }}
- name: View poetry --version
run: poetry --version
- name: Install dependencies
run: poetry install
- name: Run tests
run: poetry run pytest
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
python-version: ${{ matrix.config.python-version }}
cache: 'poetry'
- name: Install packages
run: poetry install --no-root
- name: Load cached tox
uses: actions/cache@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: true
verbose: true
path: .tox
key: tox-${{ matrix.os }}-poetry-${{ matrix.poetry-version }}-python-${{ matrix.config.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Setup API Key
env:
ORS_API_KEY: ${{ secrets.ORS_API_KEY }}
run: printf "[ORS]\napiKey = $ORS_API_KEY\n" > tests-config.ini
- name: Run tox
run: |
poetry run tox -e pytest-${{ matrix.config.tox }}

build-and-publish:
name: Build and publish Python distributions 📦 to PyPI and TestPyPI
runs-on: ubuntu-20.04
needs:
- pytest
needs: pytest
steps:
- uses: actions/checkout@v2
- name: Set up base Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Python Poetry Action
uses: abatilo/actions-poetry@v2
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- name: Install Python ${{ matrix.config.python-version }}
uses: actions/setup-python@v5
with:
poetry-version: latest
python-version: ${{ matrix.config.python-version }}
cache: 'poetry'
- name: Publish distribution 📦 with test.pypi.org
if: startsWith(github.ref, 'refs/tags/v')
run: |
Expand Down
92 changes: 33 additions & 59 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
@@ -1,78 +1,52 @@
name: tests

on:
pull_request:
branches: '**'
push:
branches: ['**']

jobs:
lint:
runs-on: ubuntu-20.04
steps:
- name: checkout
uses: actions/checkout@v2
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- uses: pre-commit/[email protected]
with:
extra_args: --all-files --show-diff-on-failure
pytest:
needs:
- lint
strategy:
fail-fast: false
matrix:
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11", "pypy3.8", "pypy3.9" ]
poetry-version: [ "1.5.1" ]
os: [ ubuntu-20.04, macos-latest, windows-latest ]
config:
- python-version: '3.8'
tox: py38
- python-version: '3.9'
tox: py39
- python-version: '3.10'
tox: py310
- python-version: '3.11'
tox: py311
poetry-version: [ "1.8.2" ]
os: [ ubuntu-22.04, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
name: Python ${{ matrix.python-version }} / Poetry ${{ matrix.poetry-version }} / ${{ matrix.os }}
name: Python ${{ matrix.config.python-version }} / Poetry ${{ matrix.poetry-version }} / ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- name: Install poetry
run: pipx install poetry
- name: Install Python ${{ matrix.config.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Select the cache folder
id: cache-folder
run: |
if [ ${{ matrix.os }} == 'ubuntu-20.04' ]; then
CACHE_FOLDER="/home/runner/.cache/pypoetry"
elif [ ${{ matrix.os }} == 'macos-latest' ]; then
CACHE_FOLDER="/Users/runner/Library/Caches/pypoetry"
elif [ ${{ matrix.os }} == 'windows-latest' ]; then
CACHE_FOLDER="C:\Users\runneradmin\AppData\Local\pypoetry\Cache"
fi
echo "Cache folder is $CACHE_FOLDER"
echo "folder=$CACHE_FOLDER" >> "$GITHUB_OUTPUT"
- name: Cache Poetry cache
python-version: ${{ matrix.config.python-version }}
cache: 'poetry'
- name: Install packages
run: poetry install --no-root
- name: Load cached tox
uses: actions/cache@v3
with:
path: ${{ steps.cache-folder.outputs.folder }}
key: poetry-cache-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.poetry-version }}
- name: Run Poetry action
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ matrix.poetry-version }}
- name: View poetry --version
run: poetry --version
- name: Install dependencies
run: poetry install
- name: Run tests
run: poetry run pytest
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: true
verbose: true
path: .tox
key: tox-${{ matrix.os }}-poetry-${{ matrix.poetry-version }}-python-${{ matrix.config.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Setup API Key
env:
ORS_API_KEY: ${{ secrets.ORS_API_KEY }}
run: printf "[ORS]\napiKey = $ORS_API_KEY\n" > tests-config.ini
- name: Run tox
run: |
poetry run tox -e pytest-${{ matrix.config.tox }}
101 changes: 80 additions & 21 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,82 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.venv*
.env*
.coverage
**/.ipynb_checkpoints/
*.geojson
*.pyc
*.in
*egg-info/
dist/
build/
/docs/build
test.py

#IDE
.spyproject/
.idea/

cover/
conda/
*coverage.xml
/setup.py
/requirements.txt
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
venv/
.python-version

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/

#Ipython Notebook
.ipynb_checkpoints

# IDE
.vscode
.idea

# API Key
openrouteservice-py/tests-config.ini

# node_modules
openrouteservice-js/node_modules
node_modules/

# Vitepress
.vitepress/cache

# Generated and used during building
client_version.txt
openrouteservice_ignore_paths.yaml
23 changes: 23 additions & 0 deletions .swagger-codegen-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Swagger Codegen Ignore
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen

# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.

# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line:
#ApiClient.cs

# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux

# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux

# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
1 change: 1 addition & 0 deletions .swagger-codegen/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0.53-SNAPSHOT
13 changes: 13 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# ref: https://docs.travis-ci.com/user/languages/python
language: python
python:
- "3.2"
- "3.3"
- "3.4"
- "3.5"
#- "3.5-dev" # 3.5 development branch
#- "nightly" # points to the latest development branch e.g. 3.6-dev
# command to install dependencies
install: "pip install -r requirements.txt"
# command to run tests
script: nosetests
20 changes: 0 additions & 20 deletions AUTHORS

This file was deleted.

Loading
Loading