Skip to content

Commit

Permalink
Merge pull request #24 from pytest-dev/python-newer
Browse files Browse the repository at this point in the history
expand python matrix
  • Loading branch information
RonnyPfannschmidt authored Sep 22, 2021
2 parents c233fcb + e463858 commit 312f892
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 80 deletions.
58 changes: 0 additions & 58 deletions .github/workflows/deploy.yaml

This file was deleted.

86 changes: 73 additions & 13 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,52 @@
name: Python application
name: "python tests+artifacts+release"

on:
pull_request:
push:
branches: [main]
branches:
- main
tags:
- "v*"
release:
types: [published]


jobs:
dist:
runs-on: ubuntu-latest
name: Python sdist/wheel
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade wheel setuptools build
- name: Build package
run: python -m build -o dist/
- uses: actions/upload-artifact@v2
with:
name: dist
path: dist

test:
runs-on: ubuntu-latest
needs: [dist]
strategy:
matrix:
# todo: extract from source
python-version: [2.7, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9]
install-style: [full, editable]

python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9, "3.10-dev"]
install-from: ["dist/*.whl"]
include:
- python-version: 3.9
install-from: "-e ."
- python-version: 3.9
install-from: "."
- python-version: 3.9
install-from: "dist/*.tar.gz"
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -25,14 +58,41 @@ jobs:
python -m pip install --upgrade pip
pip install -U setuptools setuptools_scm
pip install pytest
- uses: actions/download-artifact@v2
with:
name: dist
path: dist
- name: install editable
run: pip install -e .
if: matrix.install-style=='editable'
- name: install full
run: pip install .

if: matrix.install-style=='full'

run: pip install ${{ matrix.install-from }}
- name: pytest
run: pytest


dist_check:
runs-on: ubuntu-latest
needs: [dist]
steps:
- uses: actions/setup-python@v2
with:
python-version: "3.9"
- uses: actions/download-artifact@v2
with:
name: dist
path: dist
- run: pipx run twine check --strict dist/*

dist_upload:

runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
needs: [dist_check, test]
steps:
- uses: actions/download-artifact@v2
with:
name: dist
path: dist
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_token }}
19 changes: 10 additions & 9 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Welcome to apipkg!
------------------------
Welcome to apipkg !
-------------------

With apipkg you can control the exported namespace of a Python package and
greatly reduce the number of imports for your users.
Expand All @@ -17,6 +17,7 @@ Tutorial example
Here is a simple ``mypkg`` package that specifies one namespace
and exports two objects imported from different modules::


# mypkg/__init__.py
import apipkg
apipkg.initpkg(__name__, {
Expand Down Expand Up @@ -76,11 +77,11 @@ Feedback?

If you have questions you are welcome to

* join the #pytest channel `on irc.libera.chat
<ircs://irc.libera.chat:6697/#pytest>`_ (using an IRC client, `via webchat
<https://web.libera.chat/#pytest>`_, or `via Matrix
<https://matrix.to/#/%23pytest:libera.chat>`_).
* create an issue on https://github.com/pytest-dev/apipkg/issues
* join the **#pytest** channel on irc.libera.chat_
(using an IRC client, via webchat_, or via Matrix_).
* create an issue on the bugtracker_

have fun,
holger krekel
.. _irc.libera.chat: ircs://irc.libera.chat:6697/#pytest
.. _webchat: https://web.libera.chat/#pytest
.. _matrix: https://matrix.to/#/%23pytest:libera.chat
.. _bugtracker: https://github.com/pytest-dev/apipkg/issues

0 comments on commit 312f892

Please sign in to comment.