-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
258 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,4 +63,34 @@ jobs: | |
git push --tags origin main | ||
else | ||
echo " No changes, skipping." | ||
fi | ||
build-python: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Build and Deploy 🚀 | ||
env: | ||
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
npm install | ||
npm run generate-python | ||
git clone https://[email protected]/URLR/urlr-python clones/urlr-python &> /dev/null | ||
rsync -avI --delete --exclude='.git/' clients/urlr-python/ clones/urlr-python | ||
cd clones/urlr-python | ||
git status --verbose | ||
if [ -n "$(git status --porcelain)" ]; then | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Hugo Posnic" | ||
git add . | ||
git commit --message "Deploying from urlr/api-clients-generation@${GITHUB_SHA::8}" | ||
PACKAGE_VERSION=$(awk '/- Package version:/{print $NF}' README.md) | ||
git tag -a $PACKAGE_VERSION -m $PACKAGE_VERSION || true | ||
git push --tags origin main | ||
else | ||
echo " No changes, skipping." | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Prevent generator from creating these files: | ||
git_push.sh | ||
.travis.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Prevent generator from creating these files: | ||
git_push.sh | ||
.travis.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Prevent generator from creating these files: | ||
git_push.sh | ||
.travis.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Changelog | ||
|
||
## [0.0.1] - 2024-01-31 | ||
|
||
- First version of the URLR Python client |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
projectName: URLR | ||
packageName: urlr | ||
packageVersion: 0.0.1 | ||
infoName: URLR | ||
infoEmail: [email protected] | ||
gitUserId: urlr | ||
gitRepoId: urlr-python | ||
templateDir: openapi-generator/templates/python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
# {{{packageName}}}@{{packageVersion}} | ||
|
||
This SDK is automatically generated with the [OpenAPI Generator](https://openapi-generator.tech) project. | ||
|
||
- API version: {{appVersion}} | ||
- Package version: {{packageVersion}} | ||
{{^hideGenerationTimestamp}} | ||
- Build date: {{generatedDate}} | ||
{{/hideGenerationTimestamp}} | ||
- Build package: {{generatorClass}} | ||
{{#infoUrl}} | ||
For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) | ||
{{/infoUrl}} | ||
|
||
## Requirements | ||
|
||
Python {{{generatorLanguageVersion}}} | ||
|
||
## Installation & Usage | ||
|
||
### pip install | ||
|
||
If the python package is hosted on a repository, you can install directly using: | ||
|
||
```sh | ||
pip install git+https://{{gitHost}}/{{{gitUserId}}}/{{{gitRepoId}}}.git | ||
``` | ||
(you may need to run `pip` with root permission: `sudo pip install git+https://{{gitHost}}/{{{gitUserId}}}/{{{gitRepoId}}}.git`) | ||
|
||
Then import the package: | ||
```python | ||
import {{{packageName}}} | ||
``` | ||
|
||
### Setuptools | ||
|
||
Install via [Setuptools](http://pypi.python.org/pypi/setuptools). | ||
|
||
```sh | ||
python setup.py install --user | ||
``` | ||
(or `sudo python setup.py install` to install the package for all users) | ||
|
||
Then import the package: | ||
```python | ||
import {{{packageName}}} | ||
``` | ||
|
||
### Tests | ||
|
||
Execute `pytest` to run the tests. | ||
|
||
## Getting Started | ||
|
||
Please follow the [installation procedure](#installation--usage) and then run the following: | ||
|
||
```python | ||
``` | ||
|
||
A complete example is [available here](examples/example1.py). | ||
|
||
## API Endpoints | ||
|
||
All URIs are relative to *{{{basePath}}}* | ||
|
||
Class | Method | HTTP request | Description | ||
------------ | ------------- | ------------- | ------------- | ||
{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} | ||
{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} | ||
|
||
## Models | ||
|
||
{{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) | ||
{{/model}}{{/models}} | ||
|
||
<a id="documentation-for-authorization"></a> | ||
|
||
## Authorization | ||
|
||
{{^authMethods}}Endpoints do not require authorization.{{/authMethods}} | ||
{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}} | ||
{{#authMethods}} | ||
<a id="{{name}}"></a> | ||
### {{{name}}} | ||
|
||
{{#isApiKey}} | ||
- **Type**: API key | ||
- **API key parameter name**: {{{keyParamName}}} | ||
- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} | ||
{{/isApiKey}} | ||
{{#isBasic}} | ||
{{#isBasicBasic}} | ||
- **Type**: HTTP basic authentication | ||
{{/isBasicBasic}} | ||
{{#isBasicBearer}} | ||
- **Type**: Bearer authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}} | ||
{{/isBasicBearer}} | ||
{{#isHttpSignature}} | ||
- **Type**: HTTP signature authentication | ||
{{/isHttpSignature}} | ||
{{/isBasic}} | ||
{{#isOAuth}} | ||
- **Type**: OAuth | ||
- **Flow**: {{{flow}}} | ||
- **Authorization URL**: {{{authorizationUrl}}} | ||
- **Scopes**: {{^scopes}}N/A{{/scopes}} | ||
{{#scopes}} - **{{{scope}}}**: {{{description}}} | ||
{{/scopes}} | ||
{{/isOAuth}} | ||
|
||
{{/authMethods}} | ||
|
||
## Get help / support | ||
|
||
Please contact [[email protected]](mailto:[email protected]?subject=[GitHub]%urlr-python) and we can take more direct action toward finding a solution. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
[tool.poetry] | ||
name = "{{{packageName}}}" | ||
version = "{{{packageVersion}}}" | ||
description = "Python client for URLR" | ||
authors = ["{{infoName}}{{^infoName}}OpenAPI Generator Community{{/infoName}} <{{infoEmail}}{{^infoEmail}}[email protected]{{/infoEmail}}>"] | ||
license = "MIT" | ||
readme = "README.md" | ||
repository = "https://github.com/{{{gitUserId}}}/{{{gitRepoId}}}" | ||
keywords = ["link shortener", "api", "sdk", "client"] | ||
include = ["{{packageName}}/py.typed"] | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.7" | ||
|
||
urllib3 = ">= 1.25.3" | ||
python-dateutil = ">=2.8.2" | ||
{{#asyncio}} | ||
aiohttp = ">= 3.8.4" | ||
aiohttp-retry = ">= 2.8.3" | ||
{{/asyncio}} | ||
{{#tornado}} | ||
tornado = ">=4.2,<5" | ||
{{/tornado}} | ||
{{#hasHttpSignatureMethods}} | ||
pem = ">= 19.3.0" | ||
pycryptodome = ">= 3.9.0" | ||
{{/hasHttpSignatureMethods}} | ||
pydantic = ">=2" | ||
typing-extensions = ">=4.7.1" | ||
|
||
[tool.poetry.dev-dependencies] | ||
pytest = ">=7.2.1" | ||
tox = ">=3.9.0" | ||
flake8 = ">=4.0.0" | ||
types-python-dateutil = ">=2.8.19.14" | ||
mypy = "1.4.1" | ||
|
||
|
||
[build-system] | ||
requires = ["setuptools"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.pylint.'MESSAGES CONTROL'] | ||
extension-pkg-whitelist = "pydantic" | ||
|
||
[tool.mypy] | ||
files = [ | ||
"{{{packageName}}}", | ||
#"test", # auto-generated tests | ||
"tests", # hand-written tests | ||
] | ||
# TODO: enable "strict" once all these individual checks are passing | ||
# strict = true | ||
|
||
# List from: https://mypy.readthedocs.io/en/stable/existing_code.html#introduce-stricter-options | ||
warn_unused_configs = true | ||
warn_redundant_casts = true | ||
warn_unused_ignores = true | ||
|
||
## Getting these passing should be easy | ||
strict_equality = true | ||
strict_concatenate = true | ||
|
||
## Strongly recommend enabling this one as soon as you can | ||
check_untyped_defs = true | ||
|
||
## These shouldn't be too much additional work, but may be tricky to | ||
## get passing if you use a lot of untyped libraries | ||
disallow_subclassing_any = true | ||
disallow_untyped_decorators = true | ||
disallow_any_generics = true | ||
|
||
### These next few are various gradations of forcing use of type annotations | ||
#disallow_untyped_calls = true | ||
#disallow_incomplete_defs = true | ||
#disallow_untyped_defs = true | ||
# | ||
### This one isn't too hard to get passing, but return on investment is lower | ||
#no_implicit_reexport = true | ||
# | ||
### This one can be tricky to get passing if you use a lot of untyped libraries | ||
#warn_return_any = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters