mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-05-12 12:40:53 +00:00
[python][client] Clean up samples and CI (#17509)
* chore: Remove leftover Github action file This was probably added by mistake. A similar file is active in .github/workflows/samples-python-pydantic-v1-petstore.yaml. * chore: Remove leftover VERSION from old python-experimental sample * ci: Stop running Python integration tests in Circle CI These Python clients are all tested with Github Actions already, which is faster, more cleanly separated and only runs on modifications. I'm not cleaning up the pydantic-v1 client, I expect it to be removed soon anyway. * chore: Remove true from sample folder name python-disallowAdditionalPropertiesIfNotPresent-true -> python-disallowAdditionalPropertiesIfNotPresent
This commit is contained in:
parent
13edc5d494
commit
a0418c2855
@ -192,20 +192,6 @@ jobs:
|
||||
- checkout
|
||||
- command_build_and_test:
|
||||
nodeNo: "3"
|
||||
node4:
|
||||
machine:
|
||||
image: ubuntu-2004:202201-02
|
||||
working_directory: ~/OpenAPITools/openapi-generator
|
||||
shell: /bin/bash --login
|
||||
environment:
|
||||
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
|
||||
CIRCLE_TEST_REPORTS: /tmp/circleci-test-results
|
||||
DOCKER_GENERATOR_IMAGE_NAME: openapitools/openapi-generator
|
||||
DOCKER_CODEGEN_CLI_IMAGE_NAME: openapitools/openapi-generator-cli
|
||||
steps:
|
||||
- checkout
|
||||
- command_build_and_test:
|
||||
nodeNo: "4"
|
||||
workflows:
|
||||
version: 2
|
||||
build:
|
||||
@ -214,4 +200,3 @@ workflows:
|
||||
- node1
|
||||
- node2
|
||||
- node3
|
||||
- node4
|
||||
|
@ -15,7 +15,7 @@ jobs:
|
||||
sample:
|
||||
# clients
|
||||
- samples/client/echo_api/python
|
||||
- samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true
|
||||
- samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent
|
||||
python-version:
|
||||
- "3.7"
|
||||
- "3.8"
|
||||
|
@ -89,24 +89,6 @@ elif [ "$NODE_INDEX" = "3" ]; then
|
||||
(cd samples/client/petstore/javascript-es6 && mvn integration-test)
|
||||
(cd samples/client/petstore/javascript-promise-es6 && mvn integration-test)
|
||||
|
||||
elif [ "$NODE_INDEX" = "4" ]; then
|
||||
echo "Running node $NODE_INDEX ..."
|
||||
|
||||
#wget https://www.python.org/ftp/python/3.8.9/Python-3.8.9.tgz
|
||||
#tar -xf Python-3.8.9.tgz
|
||||
#cd Python-3.8.9
|
||||
#./configure --enable-optimizations
|
||||
#sudo make altinstall
|
||||
pyenv install --list
|
||||
pyenv install 3.7.12
|
||||
#pyenv install 2.7.14 #python2 no longer supported
|
||||
pyenv global 3.7.12
|
||||
|
||||
(cd samples/openapi3/client/petstore/python && mvn integration-test)
|
||||
(cd samples/openapi3/client/petstore/python-pydantic-v1 && mvn integration-test)
|
||||
(cd samples/openapi3/client/petstore/python-aiohttp && mvn integration-test)
|
||||
(cd samples/openapi3/client/petstore/python-pydantic-v1-aiohttp && mvn integration-test)
|
||||
|
||||
else
|
||||
echo "Running node $NODE_INDEX ..."
|
||||
java -version
|
||||
|
@ -1,5 +1,5 @@
|
||||
generatorName: python
|
||||
outputDir: samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent-true
|
||||
outputDir: samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent
|
||||
inputSpec: modules/openapi-generator/src/test/resources/3_0/echo_api.yaml
|
||||
templateDir: modules/openapi-generator/src/main/resources/python
|
||||
additionalProperties:
|
||||
|
@ -1,59 +0,0 @@
|
||||
name: "Python Client: Petstore"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- samples/openapi3/client/petstore/python-aiohttp/**
|
||||
- samples/openapi3/client/petstore/python/**
|
||||
- .github/workflows/samples-python-petstore.yaml
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Test Python client
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
python-version:
|
||||
- "3.7"
|
||||
- "3.8"
|
||||
- "3.9"
|
||||
- "3.10"
|
||||
- "3.11"
|
||||
sample:
|
||||
- samples/openapi3/client/petstore/python-aiohttp
|
||||
- samples/openapi3/client/petstore/python
|
||||
services:
|
||||
petstore-api:
|
||||
image: swaggerapi/petstore
|
||||
ports:
|
||||
- 80:8080
|
||||
env:
|
||||
SWAGGER_HOST: http://petstore.swagger.io
|
||||
SWAGGER_BASE_PATH: /v2
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v4
|
||||
id: py
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
key: ${{ runner.os }}-python-${{ steps.py.outputs.python-version }}-
|
||||
path: |
|
||||
~/.cache/pypoetry/virtualenvs/
|
||||
~/.local/pipx/venvs/poetry/
|
||||
.mypy_cache/
|
||||
|
||||
- name: Install poetry
|
||||
run: pipx install --python '${{ steps.py.outputs.python-path }}' poetry
|
||||
|
||||
- name: Install
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: poetry install
|
||||
|
||||
- name: Test
|
||||
working-directory: ${{ matrix.sample }}
|
||||
run: poetry run pytest -v
|
Before Width: | Height: | Size: 43 B After Width: | Height: | Size: 43 B |
@ -1 +0,0 @@
|
||||
7.0.0-SNAPSHOT
|
@ -1,2 +0,0 @@
|
||||
tox
|
||||
flake8
|
@ -1,46 +0,0 @@
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>PythonNextgenAioHttpPetstoreTests</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>Python OpenAPI3 Petstore Client</name>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>1.2.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>test</id>
|
||||
<phase>integration-test</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>bash</executable>
|
||||
<arguments>
|
||||
<argument>test_python3.sh</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
@ -1,31 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
REQUIREMENTS_FILE=dev-requirements.txt
|
||||
REQUIREMENTS_OUT=dev-requirements.txt.log
|
||||
SETUP_OUT=*.egg-info
|
||||
VENV=.venv
|
||||
DEACTIVE=false
|
||||
|
||||
export LC_ALL=en_US.UTF-8
|
||||
export LANG=en_US.UTF-8
|
||||
|
||||
### set virtualenv
|
||||
if [ -z "$VIRTUAL_ENV" ]; then
|
||||
virtualenv $VENV --always-copy
|
||||
source $VENV/bin/activate
|
||||
DEACTIVE=true
|
||||
fi
|
||||
|
||||
### install dependencies
|
||||
pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT
|
||||
|
||||
### run tests
|
||||
tox || exit 1
|
||||
|
||||
### static analysis of code
|
||||
#flake8 --show-source petstore_api/
|
||||
|
||||
### deactivate virtualenv
|
||||
#if [ $DEACTIVE == true ]; then
|
||||
# deactivate
|
||||
#fi
|
@ -21,4 +21,3 @@
|
||||
#docs/*.md
|
||||
# Then explicitly reverse the ignore rule for a single file:
|
||||
#!docs/README.md
|
||||
tox.ini
|
||||
|
@ -200,3 +200,4 @@ setup.cfg
|
||||
setup.py
|
||||
test-requirements.txt
|
||||
test/__init__.py
|
||||
tox.ini
|
||||
|
@ -1,21 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
REQUIREMENTS_FILE=dev-requirements.txt
|
||||
REQUIREMENTS_OUT=dev-requirements.txt.log
|
||||
SETUP_OUT=*.egg-info
|
||||
VENV=.venv
|
||||
|
||||
clean:
|
||||
rm -rf $(REQUIREMENTS_OUT)
|
||||
rm -rf $(SETUP_OUT)
|
||||
rm -rf $(VENV)
|
||||
rm -rf .tox
|
||||
rm -rf .coverage
|
||||
find . -name "*.py[oc]" -delete
|
||||
find . -name "__pycache__" -delete
|
||||
|
||||
test: clean
|
||||
bash ./test_python3.sh
|
||||
|
||||
test-all: clean
|
||||
bash ./test_python3.sh
|
@ -1,2 +0,0 @@
|
||||
tox
|
||||
flake8
|
@ -1,46 +0,0 @@
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>PythonPetstoreTests</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>Python OpenAPI3 Petstore Client</name>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>1.2.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>test</id>
|
||||
<phase>integration-test</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>make</executable>
|
||||
<arguments>
|
||||
<argument>test-all</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
@ -1,31 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
REQUIREMENTS_FILE=dev-requirements.txt
|
||||
REQUIREMENTS_OUT=dev-requirements.txt.log
|
||||
SETUP_OUT=*.egg-info
|
||||
VENV=venv
|
||||
DEACTIVE=false
|
||||
|
||||
export LC_ALL=en_US.UTF-8
|
||||
export LANG=en_US.UTF-8
|
||||
|
||||
### set virtualenv
|
||||
if [ -z "$VIRTUAL_ENV" ]; then
|
||||
virtualenv $VENV --always-copy
|
||||
source $VENV/bin/activate
|
||||
DEACTIVE=true
|
||||
fi
|
||||
|
||||
### install dependencies
|
||||
pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT
|
||||
|
||||
### run tests
|
||||
tox || exit 1
|
||||
|
||||
### static analysis of code
|
||||
#flake8 --show-source petstore_api/
|
||||
|
||||
### deactivate virtualenv
|
||||
#if [ $DEACTIVE == true ]; then
|
||||
# deactivate
|
||||
#fi
|
Loading…
x
Reference in New Issue
Block a user