Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/xnx/pyvalem
Browse files Browse the repository at this point in the history
  • Loading branch information
xnx committed Jan 14, 2022
2 parents 17b2a22 + 230b715 commit f58cdfe
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 17 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/python-pkg-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Upload python package to PyPI

on:
release:
types: [published]

jobs:
deploy:
name: Build and deploy the package to TestPyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade build
pip install --upgrade twine
- name: Build package
run: |
python -m build --outdir dist/
twine check dist/*
- name: Publish package
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true
32 changes: 32 additions & 0 deletions .github/workflows/python-pkg-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Install and test the package

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build-n-test:
name: Install and test the package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Install the package locally
run: |
python -m pip install --upgrade pip
pip install .
- name: Install dependencies for testing
run: |
pip install pytest-cov
pip install black
- name: Test with pytest
run: |
pytest --cov
- name: Check code format
run: |
black --check .
27 changes: 26 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
[build-system]
requires = ["setuptools>=43", "wheel"]
build-backend = "setuptools.build_meta"
build-backend = "setuptools.build_meta"

[tool.pytest.ini_options]
addopts = "--doctest-modules --doctest-glob='README.rst'"

[tool.tox]
legacy_tox_ini = """
[tox]
envlist = py3{10,9,8,7}-pp_{l,h}, py3{6}-pp_{l,h}-ir_{l,h}
skip_missing_interpreters = true
[testenv]
deps =
pytest
pp_l: pyparsing==2.3.0
pp_h: pyparsing
ir_l: importlib-resources==1.0
ir_h: importlib-resources
commands = pytest
"""

[tool.coverage.run]
omit = ["tests/*", "src/pyvalem/__init__.py", "doc/*"]

[tool.coverage.html]
directory = "htmlcov"
2 changes: 0 additions & 2 deletions pytest.ini

This file was deleted.

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"pyparsing>=2.3",
'importlib-resources>=1.0; python_version < "3.7.0"',
],
extras_require={"dev": ["black", "coverage", "pytest", "tox", "ipython"]},
extras_require={"dev": ["black", "pytest-cov", "tox", "ipython"]},
# package_data will include all the resolved globs into both the wheel and sdist
package_data={"pyvalem": ["*.txt"]},
# no need for MANIFEST.in, which should be reserved only for build-time files
Expand Down
13 changes: 0 additions & 13 deletions tox.ini

This file was deleted.

0 comments on commit f58cdfe

Please sign in to comment.