Skip to content

Commit

Permalink
Merge pull request #301 from sarugaku/ci/update
Browse files Browse the repository at this point in the history
Drop support for Python < 3.6
  • Loading branch information
frostming committed Nov 3, 2021
2 parents 84bfccd + 4a79f58 commit a0544a0
Show file tree
Hide file tree
Showing 73 changed files with 868 additions and 1,812 deletions.
34 changes: 0 additions & 34 deletions .azure-pipelines/templates/build-package.yml

This file was deleted.

5 changes: 0 additions & 5 deletions .azure-pipelines/templates/install-dependencies.yml

This file was deleted.

22 changes: 0 additions & 22 deletions .azure-pipelines/templates/run-coverage.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .azure-pipelines/templates/run-tests.yml

This file was deleted.

40 changes: 24 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,32 +29,44 @@ on:
- ".editorconfig"

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/action@v2.0.3
test:
name: ${{matrix.os}} / ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]
os: [MacOS, Ubuntu, Windows]
python-version: [3.6, 3.7, 3.8, 3.9, "3.10"]
os: [macos, ubuntu, windows]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Get python path
id: python-path
- name: Get pip cache dir
id: pip-cache
run: |
echo ::set-output name=path::$(python -c "import sys; print(sys.executable)")
echo "::set-output name=dir::$(pip cache dir)"
- name: Install latest pip, setuptools, wheel
run: |
python -m pip install --upgrade coveralls pip setuptools wheel --upgrade-strategy=eager
python -m pip install --upgrade --pre pipenv
- name: pip cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('setup.cfg') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Dev Dependencies
run: python -m pip install --upgrade .[dev]

- name: Run tests
env:
Expand All @@ -67,12 +79,8 @@ jobs:
COVERALLS_SERVICE_NAME: github
COVERALLS_SERVICE_JOB_ID: ${{ github.run_id }}
COVERALLS_PARALLEL: true
PIPENV_NOSPIN: "1"
CI: "1"
run: |
git submodule sync
git submodule update --init --recursive
python -m pipenv install --dev --python=${{ steps.python-path.outputs.path }}
pipenv run coverage run -p -m pytest -ra tests/
pipenv run coverage combine
coveralls
nox -s coverage
87 changes: 43 additions & 44 deletions .github/workflows/pypi_upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
# Sequence of patterns matched against refs/tags
tags:
- v?[0-9]+.[0-9]+.[0-9]+ # add .* to allow dev releases
- v?[0-9]+.[0-9]+.[0-9]+ # add .* to allow dev releases

jobs:
build:
Expand All @@ -14,50 +14,49 @@ jobs:
CI: "1"

steps:
- name: Checkout code
uses: actions/checkout@v1
- name: Checkout code
uses: actions/checkout@v2

- uses: webfactory/ssh-agent@v0.1.1
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Create Release
id: create_release
uses: actions/create-release@v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

- name: Create Release
id: create_release
uses: actions/create-release@v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install nox
run: |
python -m pip install --upgrade .[dev]
- name: Build wheels
run: |
nox -s package
# to upload to test pypi, pass repository_url: https://test.pypi.org/legacy/ and use secrets.TEST_PYPI_TOKEN
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
packages_dir: dist/
# git push https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:master
# we need to use a deploy key for this to get around branch protection as the default token fails
- name: Pre-bump
run: |
git config --local user.name 'Github Action'
git config --local user.email action@github.com
nox -s bump_version
git commit -am 'pre-bump'
- name: Install latest tools for build
run: |
python -m pip install --upgrade pip setuptools wheel pipenv invoke
python -m pipenv install --dev --pre
python -m pipenv run pip install invoke
- name: Build wheels
run: |
python -m pipenv run inv build
# to upload to test pypi, pass repository_url: https://test.pypi.org/legacy/ and use secrets.TEST_PYPI_TOKEN
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
packages_dir: dist/
# git push https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:master
# we need to use a deploy key for this to get around branch protection as the default token fails
- name: Pre-bump
run: |
git config --local user.name 'Github Action'
git config --local user.email action@github.com
python -m pipenv run inv bump-version -t dev
git commit -am 'pre-bump'
git push git@github.com:${{ github.repository }}.git HEAD:master
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main
26 changes: 11 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
repos:
- repo: https://github.com/psf/black
rev: 19.10b0
rev: 21.8b0
hooks:
- id: black
language_version: python3.6
#- repo: https://github.com/pre-commit/pre-commit-hooks
#rev: v2.0.0
#hooks:
#- id: flake8

- repo: https://github.com/asottile/seed-isort-config
rev: v2.1.1
- repo: https://github.com/PyCQA/flake8
rev: 3.9.2
hooks:
- id: seed-isort-config
args: [
--application-directories=src/requirementslib,
--settings-path=./,
]
- id: flake8
additional_dependencies:
- flake8-bugbear

- repo: https://github.com/timothycrosley/isort
rev: 4.3.21
- repo: https://github.com/PyCQA/isort
rev: 5.9.3
hooks:
- id: isort
args:
- --settings-file
- pyproject.toml

- repo: https://github.com/myint/docformatter
rev: v1.3.1
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright 2019 Dan Ryan.
Copyright 2019-2021 Dan Ryan and Frost Ming.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
89 changes: 0 additions & 89 deletions azure-pipelines.yml

This file was deleted.

0 comments on commit a0544a0

Please sign in to comment.