diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..6c99590 --- /dev/null +++ b/.github/workflows/lint.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..181e70a --- /dev/null +++ b/.github/workflows/release.yml @@ -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/* diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 0000000..d20936e --- /dev/null +++ b/.github/workflows/tests.yaml @@ -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 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 257243e..0000000 --- a/.travis.yml +++ /dev/null @@ -1,89 +0,0 @@ -dist: xenial -language: python - -env: - global: - - PYTEST_ADDOPTS="-vv --cov --cov-report=xml" - -stages: - - name: test - if: tag IS NOT present - - name: release - if: tag IS present - -jobs: - include: - - os: windows - language: shell - env: - - PATH=/c/Python38:/c/Python38/Scripts:$PATH - - TOXENV=py38-coverage - before_install: - - choco install --no-progress python - - - os: osx - osx_image: xcode10.2 - language: generic - env: TOXENV=py37-coverage - before_install: - - ln -sfn "$(which python3)" /usr/local/bin/python - - python -V - - test $(python -c 'import sys; print("%d%d" % sys.version_info[0:2])') = 37 - - - python: '2.7' - env: TOXENV=py27-coverage - - python: '3.4' - env: TOXENV=py34-coverage - - python: '3.5' - env: TOXENV=py35-coverage - - python: '3.6' - env: TOXENV=py36-coverage - - python: '3.7' - env: TOXENV=py37-coverage - - python: '3.8' - env: TOXENV=py38-coverage - - python: 'pypy' - env: TOXENV=pypy-coverage - - python: 'pypy3' - env: TOXENV=pypy3-coverage - - - python: '3.7' - env: TOXENV=checkqa - - - stage: release - script: skip - install: skip - after_success: true - env: - deploy: - provider: pypi - distributions: sdist bdist_wheel - user: __token__ - password: - secure: "GCyMei2qFzd9AN0EmT9AGqO0zQFtab8Yff4O9zmpDn34hk7TRhQdAHqPXTj0GovYjN783y31jQdVPbEsFiXUAtEu6rfOBwTtVvNCHGVdDQ0nhZFZVwYD3NfhaV1UCq/ahs5AdUEARAPbR8lviH4PMByrMs3x+ul+bHfZ70QlD1xvC/wlkZ+C/FWc5WiKbkqM5W/CUJoOnX7C5Cx/cI/VZI8X3N77t1J7fW4CEvk3nvU9CW8gDCcuJhq4Hr4oW85PsSCcJagwo1im3WSK+5rNTFlihoE1kGYtrDlWFrNFruAwobk9LSjk+GKTZqD6PFxilON/hiKavxHNYEBwwnfvpDTK87lQHU1LuLOjNMDn8pPOj8uvvKrx9y2BgtFcJzEq9oudtJOKYcxoVpLm/tmqB4QzlTWpOKXk769Sk7lZM9n+psu6wtAd1X8GH5qFon5z0YnNmaNFew5bKs3R/L3Eav1OyskA0zi4f/h8s98apnY4AGX7ul/xxoJhp3OXiSN75fMI6SUiNZLFgRUmFNqJ6pzCqHDbV0y60EeH+5BBLIdKc/D+YsuqDZYAjkN4ze6JVzGtxSSK9tuZyKJJ7zPXT1qdZxXRF0XOHRcVTxl+tNBncCmVvrJmf8QvQ6FteShZqTu3qfWWAubCOGVrxr0aVVZkYR6izNrAsp+J2/ETs5Q=" - on: - tags: true - repo: pdbpp/fancycompleter - -install: - - pip install tox==3.12.1 - # NOTE: need to upgrade virtualenv to allow "Direct url requirement" with - # installation in tox. - - pip install virtualenv==16.6.0 - -script: - - tox - -after_script: - - | - if [[ "${TOXENV%-coverage}" != "$TOXENV" ]]; then - curl --version - curl -S -L --connect-timeout 5 --retry 6 -s https://codecov.io/bash > codecov.sh - bash codecov.sh -Z -X fix -f coverage.xml -n $TOXENV -F "${TRAVIS_OS_NAME}" - fi - -# Only master and releases. PRs are used otherwise. -branches: - only: - - master - - /^\d+\.\d+(\.\d+)?(-\S*)?$/ diff --git a/setup.py b/setup.py index 7d90960..31dfe36 100644 --- a/setup.py +++ b/setup.py @@ -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='anto.cuni@gmail.com', - 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="anto.cuni@gmail.com", + 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'", - ] + ], ) diff --git a/tox.ini b/tox.ini index 41830fe..0749f80 100644 --- a/tox.ini +++ b/tox.ini @@ -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 =