Skip to content

Commit

Permalink
[DRE-94] Add publisher pypi (#76)
Browse files Browse the repository at this point in the history
* Add publisher pypi

* change python version publisher

* change setuptools version

* change setuptools version

* change setuptools version

* change setuptools version

* Change config openapi python

* remove version

* remove version

* setuptools_scm

* Change action publisher config

* Change dynamic version

* Change validate version

* Change pypi test
  • Loading branch information
ezerozen authored Jun 9, 2023
1 parent e3b309a commit 1590eee
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 9 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: publish on pypi
on:
release:
types: [published]
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Check if release creator is an authors
run: |
if [[ $(jq '.sender.type' $GITHUB_EVENT_PATH) == '"User"' ]]; then
creator_login=${{ github.event.release.author.login }}
if ! grep -q $creator_login AUTHORS.md; then
echo "Release creator is not an code owner, skipping the rest of the workflow."
exit 1
fi
fi
- name: Validate release version
run: |
tag_name=${{ github.event.release.tag_name }}
version=$(cat VERSION)
if [ $tag_name != $version ]; then
echo "Release tag_name is not the same that in file VERSION"
exit 1
fi
- name: Build project
run: python3 -m pip install --upgrade build && python3 -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true
3 changes: 1 addition & 2 deletions .openapi-generator-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ git_push.sh
appveyor.yml
.openapi-generator/
.openapi-generator
.github/workflows/python.yml
README.md
.github/workflows/python.yml
1 change: 1 addition & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
AUTHORS.md
CODE_OF_CONDUCT.md
LICENSE
README.md
VERSION
conekta/__init__.py
conekta/api/__init__.py
Expand Down
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
exclude .devcontainer
exclude .vscode
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ Then import the package:
import conekta
```

### Tests

Execute `pytest` to run the tests.

## Getting Started

Please follow the [installation procedure](#installation--usage) and then run the following:
Expand All @@ -52,12 +56,6 @@ import conekta
from conekta.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.conekta.io
# See configuration.py for a list of all supported configuration parameters.
configuration = conekta.Configuration(
host = "https://api.conekta.io"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
Expand Down Expand Up @@ -385,11 +383,14 @@ Class | Method | HTTP request | Description
- [WebhookUpdateRequest](docs/WebhookUpdateRequest.md)
- [WhitelistlistRuleResponse](docs/WhitelistlistRuleResponse.md)


<a id="documentation-for-authorization"></a>
## Documentation For Authorization


## bearerAuth
Authentication schemes defined for the API:
<a id="bearerAuth"></a>
### bearerAuth

- **Type**: Bearer authentication

Expand Down
21 changes: 21 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,26 @@ flake8 = ">=4.0.0"
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]

[tool.pylint.'MESSAGES CONTROL']
extension-pkg-whitelist = "pydantic"

[project]
name = "conekta"
version = "6.0.0"
authors = [
{ name="Engineering Conekta", email="[email protected]" },
]
description = "This is a Python library that allows interaction with https://api.conekta.io API."
readme = "README.md"
requires-python = ">=3.7"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]

[project.urls]
"Homepage" = "https://github.com/conekta/conekta-python"
"Bug Tracker" = "https://github.com/conekta/conekta-python/issues"

0 comments on commit 1590eee

Please sign in to comment.