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

ci reboot #38

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
20 changes: 18 additions & 2 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
[flake8]
max-line-length = 88
ignore = E501, E203, W503
min_python_version = 3.6.0
max-line-length = 120
ban-relative-imports = true
# flake8-use-fstring: https://github.com/MichaelKim0407/flake8-use-fstring#--percent-greedy-and---format-greedy
format-greedy = 0
inline-quotes = double
enable-extensions = TC, TC1
type-checking-exempt-modules = typing, typing-extensions
eradicate-whitelist-extend = ^-.*;
extend-ignore =
# E203: Whitespace before ':' (pycqa/pycodestyle#373)
E203,
# SIM106: Handle error-cases first
SIM106,
# ANN101: Missing type annotation for self in method
ANN101,
# ANN102: Missing type annotation for cls in classmethod
ANN102,
137 changes: 0 additions & 137 deletions .github/workflows/installer.yml

This file was deleted.

98 changes: 98 additions & 0 deletions .github/workflows/support-matrix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Support Matrix

on:
push:
paths:
- 'install-poetry.py'
- '.github/workflows/support-matrix.yml'
branches:
- main
pull_request:
paths:
- 'install-poetry.py'
- '.github/workflows/support-matrix.yml'
branches:
- '**'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
feature-matrix:
name: ${{ matrix.python-version }} / install-poetry.py ${{ matrix.args }}
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11-dev"]
experimental: [false]
args:
- ""
- "--version 1.1.15"
- "--version 1.2.0"
- "--preview"
- "--git https://github.com/python-poetry/poetry.git"
- "--path ./poetry"
include:
- args: "--version 1.1.15"
python-version: "3.6"
experimental: false
- python-version: "3.11-dev"
experimental: true
steps:
- uses: actions/checkout@v3

- uses: actions/checkout@v3
with:
repository: python-poetry/poetry
path: poetry

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

- name: Install Poetry
run: |
python install-poetry.py -y ${{ matrix.args }}
echo "$HOME/.local/bin" >> $GITHUB_PATH
poetry --version

- name: Upload Failure Log
uses: actions/upload-artifact@v2
if: failure()
with:
name: poetry-installer-error.log
path: poetry-installer-error-*.log

- name: Test new project
run: |
poetry new test_project
cd test_project

poetry env use python3
if [ "$(poetry run python --version)" != "$(python3 --version)" ]; then
echo "ERROR: Virtual environment Python version does not match expected system version" >&2
exit 1
fi

poetry debug info

- name: Test existing project
if: ${{ !contains(matrix.args, '--version 1.1') }} # Poetry makes use of Poetry 1.2+ features
working-directory: poetry
run: |
poetry install
poetry build
poetry run poetry --version
poetry run poetry debug info

- name: Uninstall Poetry
run: |
python install-poetry.py -y --uninstall
if command -v "poetry" >/dev/null; then
which poetry
echo "ERROR: Failed to uninstall Poetry?" >&2
exit 1
fi
80 changes: 59 additions & 21 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,72 @@
ci:
autofix_prs: false

repos:
- repo: https://github.com/psf/black
rev: 22.8.0
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: black
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-merge-conflict
- id: check-case-conflict
- id: check-json
- id: check-toml
- id: check-yaml
- id: pretty-format-json
args: [--autofix, --no-ensure-ascii, --no-sort-keys]
- id: check-ast
- id: debug-statements
- id: check-docstring-first

- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.9.0
hooks:
- id: flake8
additional_dependencies:
- id: python-check-mock-methods
- id: python-use-type-annotations
- id: python-check-blanket-noqa

- repo: https://github.com/asottile/yesqa
rev: v1.4.0
hooks:
- id: yesqa
additional_dependencies: &flake8_deps
# - flake8-annotations==2.9.0
- flake8-broken-line==0.5.0
- flake8-bugbear==22.7.1
- flake8-comprehensions==3.10.0
- flake8-eradicate==1.3.0
- flake8-quotes==3.3.1
- flake8-simplify==0.19.3
- flake8-tidy-imports==4.8.0
- flake8-type-checking==2.1.2
- flake8-typing-imports==1.12.0
- flake8-use-fstring==1.4
- pep8-naming==0.13.1

- repo: https://github.com/PyCQA/isort
- repo: https://github.com/asottile/pyupgrade
rev: v2.37.3
hooks:
- id: pyupgrade
args: [--py36-plus]

- repo: https://github.com/hadialqattan/pycln
rev: v2.1.1
hooks:
- id: pycln
args: [--all]

- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
- repo: https://github.com/psf/black
rev: 22.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: debug-statements
- id: pretty-format-json
args:
- --autofix
- id: check-json
- id: black

- repo: https://github.com/asottile/pyupgrade
rev: v2.34.0
- repo: https://github.com/pycqa/flake8
rev: 5.0.4
hooks:
- id: pyupgrade
args: [--py36-plus]
- id: flake8
additional_dependencies: *flake8_deps
Loading