Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub actions #48

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: lint

on:
push:
branches:
- "master"
- "release-*"
pull_request:
branches:
- "master"
- "release-*"
workflow_dispatch:

jobs:
tests:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-latest, macos-latest]
pyv: ["3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.pyv }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.pyv }}

- name: set PY_CACHE_KEY
run: echo "PY_CACHE_KEY=$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" >> $GITHUB_ENV
- name: Cache .tox
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/.tox/checkqa
key: "tox-lint|${{ matrix.os }}|${{ env.PY_CACHE_KEY }}|${{ hashFiles('tox.ini', 'setup.*') }}"

- name: Update pip/setuptools
run: |
pip install -U pip setuptools

- name: Install tox
run: python -m pip install tox

- name: Version information
run: python -m pip list

- name: Lint
run: tox -v -e checkqa
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Publish package to PyPI

on:
release:
types:
- published
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install requirements
run: |
pip install -U pip twine build
- name: Build
run: python -m build
- run: check-manifest
- run: twine check dist/*
- name: Publish to PyPI
env:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: twine upload dist/*
85 changes: 85 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Tests

on:
push:
branches:
- "master"
- "release-*"
pull_request:
branches:
- "master"
- "release-*"
workflow_dispatch:

env:
PYTEST_ADDOPTS: "-vv --cov-report=xml:coverage-ci.xml"
PIP_DISABLE_PIP_VERSION_CHECK: true

defaults:
run:
shell: bash

jobs:
tests:
name: Tests
runs-on: ${{ matrix.os }}
timeout-minutes: 5

strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-latest, macos-latest]
python: ["3.8"]
tox_env: ["coverage"]
include:
- tox_env: "py39-coverage"
os: ubuntu-20.04
python: "3.9"
- tox_env: "py310-coverage"
python: "3.10"
os: ubuntu-20.04
- tox_env: "py311-coverage"
python: "3.11"
os: ubuntu-20.04

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}

- name: set PY_CACHE_KEY
run: echo "PY_CACHE_KEY=$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" >> $GITHUB_ENV
- name: Cache .tox
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/.tox/${{ matrix.tox_env }}
key: "tox|${{ matrix.os }}|${{ matrix.tox_env }}|${{ env.PY_CACHE_KEY }}|${{ hashFiles('tox.ini', 'setup.*') }}"

- name: Update tools and print info
run: |
pip install -U pip setuptools virtualenv
pip list

- name: Install tox
run: pip install tox

- name: Setup tox environment
id: setup_tox
run: tox --notest -v -e ${{ matrix.tox_env }}

- name: Run tests
run: |
python -m tox -v -e ${{ matrix.tox_env }}

- name: Report coverage
if: always() && (contains(matrix.tox_env, 'coverage') && (steps.setup_tox.outcome == 'success'))
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./coverage-ci.xml
flags: ${{ runner.os }}
name: ${{ matrix.tox_env }}
fail_ci_if_error: true
89 changes: 0 additions & 89 deletions .travis.yml

This file was deleted.

30 changes: 14 additions & 16 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,34 +1,32 @@
from setuptools import setup

setup(
name='fancycompleter',
name="fancycompleter",
setup_requires="setupmeta",
versioning="devcommit",
maintainer="Daniel Hahler",
url='https://github.com/pdbpp/fancycompleter',
author='Antonio Cuni',
author_email='[email protected]',
py_modules=['fancycompleter'],
license='BSD',
description='colorful TAB completion for Python prompt',
keywords='rlcompleter prompt tab color completion',
url="https://github.com/pdbpp/fancycompleter",
author="Antonio Cuni",
author_email="[email protected]",
py_modules=["fancycompleter"],
license="BSD",
description="colorful TAB completion for Python prompt",
keywords="rlcompleter prompt tab color completion",
classifiers=[
"Development Status :: 4 - Beta",
"Environment :: Console",
"License :: OSI Approved :: BSD License",
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Intended Audience :: Developers",
"Operating System :: POSIX",
"Operating System :: Microsoft :: Windows",
"Topic :: Utilities",
],
],
install_requires=[
"pyrepl @ git+https://github.com/pdbpp/pyrepl@master#egg=pyrepl",
"pyreadline;platform_system=='Windows'",
]
],
)
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{27,34,35,36,37,38,py,py3}, checkqa
envlist = py{38,39,310,311,py3}, checkqa

[testenv]
deps =
Expand Down