Skip to content

Commit

Permalink
Merge pull request #10 from tefra/update-things
Browse files Browse the repository at this point in the history
Update things
  • Loading branch information
tefra committed Nov 6, 2022
2 parents 3f4ae58 + f2b4633 commit 707ea22
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 68 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/publish.yml
@@ -0,0 +1,39 @@
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI

on:
release:
types: [released]

jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
42 changes: 21 additions & 21 deletions .github/workflows/tests.yml
Expand Up @@ -13,25 +13,21 @@ jobs:
strategy:
fail-fast: false
matrix:
python: [ "3.6", "3.7", "3.8", "3.9", "3.10" ]
python: [ "3.7", "3.8", "3.9", "3.10", "3.11" ]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install libxml2
if: startsWith(matrix.python, 'pypy')
run: |
sudo apt-get install libxml2-dev libxslt-dev
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools tox codecov
- name: Test
run: |
tox -e py -- --cov=./xsdata_attrs --cov-branch --doctest-glob="docs/*.rst"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
Expand All @@ -41,31 +37,35 @@ jobs:
strategy:
fail-fast: false
matrix:
python: [ "3.9" ]
python: [ "3.10" ]
collection:
- { name: "Amadeus", id: "amadeus" }
- { name: "Sabre", id: "sabre" }
- { name: "Travelport", id: "travelport" }
- { name: "Autosar", id: "autosar" }
- { name: "BPMN", id: "bpmn" }
- { name: "Common Types", id: "common_types" }
- { name: "ReqIF", id: "reqif" }
- { name: "NPO API", id: "npo" }
- { name: "Crossref Metadata", id: "crossref" }
- { name: "DateX II", id: "datexii" }
# - { name: "DefXML", id: "defxml" }
- { name: "EWP", id: "ewp" }
- { name: "UBL", id: "ubl" }
- { name: "Generali", id: "generali" }
- { name: "NeTEx", id: "netex" }
- { name: "DefXML", id: "defxml" }
- { name: "NPO API", id: "npo" }
- { name: "ReqIF", id: "reqif" }
- { name: "Sabre", id: "sabre" }
- { name: "SpaceX", id: "spacex" }
- { name: "Autosar", id: "autosar" }
- { name: "Travelport", id: "travelport" }
- { name: "UBL", id: "ubl" }
- { name: "XCBL", id: "xcbl" }
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: tefra/xsdata-samples
ref: master
submodules: true
path: xsdata-samples
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
Expand All @@ -88,6 +88,6 @@ jobs:
name: Pre-commit Hooks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: pre-commit/action@v2.0.2
30 changes: 17 additions & 13 deletions .pre-commit-config.yaml
Expand Up @@ -2,18 +2,22 @@ exclude: tests/fixtures

repos:
- repo: https://github.com/asottile/pyupgrade
rev: v2.32.0
rev: v3.2.0
hooks:
- id: pyupgrade
args: [--py37-plus]
args: [ --py37-plus ]
- repo: https://github.com/asottile/reorder_python_imports
rev: v3.0.1
rev: v3.9.0
hooks:
- id: reorder-python-imports
- repo: https://github.com/ambv/black
rev: 22.3.0
rev: 22.10.0
hooks:
- id: black
- repo: https://github.com/PyCQA/autoflake
rev: v1.7.7
hooks:
- id: autoflake
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
hooks:
Expand All @@ -23,30 +27,30 @@ repos:
flake8-annotations,
flake8-comprehensions,
]
args: ["--suppress-none-returning"]
args: [ "--suppress-none-returning" ]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
rev: v4.3.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: debug-statements
- repo: https://github.com/myint/docformatter
rev: v1.4
rev: v1.5.0
hooks:
- id: docformatter
args: ["--in-place", "--pre-summary-newline"]
args: [ "--in-place", "--pre-summary-newline" ]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.942
rev: v0.982
hooks:
- id: mypy
additional_dependencies: [tokenize-rt, types-attrs]
additional_dependencies: [ tokenize-rt, types-attrs ]
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v1.20.1
rev: v2.2.0
hooks:
- id: setup-cfg-fmt
args: ["--max-py-version=3.11"]
args: [ "--min-py3-version=3.7", "--max-py-version=3.11", "--include-version-classifiers" ]
- repo: https://github.com/PyCQA/doc8
rev: 0.11.1
rev: v1.0.0
hooks:
- id: doc8
3 changes: 1 addition & 2 deletions setup.cfg
Expand Up @@ -16,7 +16,6 @@ classifiers =
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Expand All @@ -35,7 +34,7 @@ packages = xsdata_attrs
install_requires =
attrs>=19.2.0
xsdata>=21.8
python_requires = >=3.6
python_requires = >=3.7
include_package_data = True

[options.entry_points]
Expand Down
33 changes: 1 addition & 32 deletions tox.ini
@@ -1,5 +1,5 @@
[tox]
envlist = py36,py37,py38,py39,py310,pypy3
envlist = py36,py37,py38,py39,py310,py311,pypy3
skip_missing_interpreters = true

[testenv]
Expand All @@ -12,34 +12,3 @@ extras = docs,cli
changedir = docs
commands =
sphinx-build -b html . _build

[testenv:build]
basepython = python3
skip_install = true
deps =
wheel
setuptools
twine
whitelist_externals = rm
commands =
rm -fr dist
python setup.py bdist_wheel sdist
twine check dist/*

[testenv:release]
basepython = python3
skip_install = true
deps = {[testenv:build]deps}
commands_pre =
{[testenv:build]commands}
commands =
twine upload --skip-existing dist/*

[testenv:testrelease]
basepython = python3
skip_install = true
deps = {[testenv:build]deps}
commands_pre =
{[testenv:build]commands}
commands =
twine upload --repository-url https://test.pypi.org/legacy/ --skip-existing dist/*

0 comments on commit 707ea22

Please sign in to comment.