Skip to content

Commit e04bea6

Browse files
[#34] Relax black version requirements (PR #88)
* move `black` and `autopep8` from `install_requires` to `extras_require` * add `usage` workflow to test installation of `pipenv-setup`, `pipenv-setup[black]`, and `pipenv-setup[autopep8]` * update behavior: if `black` is present, use it to format `setup.py`; if `black` isn't installed, try `autopep8`; if neither is installed, don't format `setup.py`
1 parent d3cc76f commit e04bea6

File tree

7 files changed

+454
-302
lines changed

7 files changed

+454
-302
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
name: test-${{ matrix.os }}-python${{ matrix.python-version }}
1818
runs-on: ${{ matrix.os }}
1919
strategy:
20+
fail-fast: false
2021
matrix:
2122
# this works like a loop; think `pytest.mark.parametrize`
2223
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]

.github/workflows/usage.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# -------------------------------------------------------------------------------------
2+
# Summary: Test the external CLI usage of this project.
3+
# Created: 2021-11-20 18:44:48
4+
# Author: Bryant Finney <[email protected]> (https://bryant-finney.github.io/about)
5+
# -------------------------------------------------------------------------------------
6+
name: Test Usage
7+
8+
on:
9+
push:
10+
pull_request:
11+
workflow_dispatch:
12+
release:
13+
types: [published]
14+
15+
jobs:
16+
build:
17+
name: Build wheel
18+
outputs:
19+
wheel: ${{ steps.build.outputs.wheel }}
20+
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v2
24+
- uses: actions/setup-python@v2
25+
26+
- name: Prepare build system
27+
run: pip install --upgrade pip setuptools wheel
28+
29+
- name: Build wheel and source distribution 🛠️
30+
id: build
31+
run: |
32+
python setup.py sdist bdist_wheel
33+
echo "::set-output name=wheel::$(ls ./dist/*.whl)"
34+
35+
- name: Upload build artifacts ⬆️
36+
uses: actions/upload-artifact@v2
37+
with:
38+
name: dist
39+
path: dist/*.whl
40+
41+
test-install:
42+
name: "${{ matrix.os }} | py${{ matrix.py }}: ${{ matrix.manager }} install ${{ needs.build.outputs.wheel }}[${{ matrix.extras }}]"
43+
needs: build
44+
runs-on: ${{ matrix.os }}
45+
strategy:
46+
fail-fast: false
47+
matrix:
48+
extras: ["", "dev", "black", "autopep8"]
49+
manager: [pip, pipenv]
50+
os: [ubuntu-latest, windows-latest, macos-latest]
51+
py: [3.7, 3.8]
52+
53+
steps:
54+
- uses: actions/setup-python@v2
55+
with:
56+
python-version: ${{ matrix.py }}
57+
58+
- name: Update ${{ matrix.manager }}
59+
run: echo "${{ matrix.manager }}" | grep pipenv | xargs pip install --upgrade pip
60+
61+
- name: Download build artifacts ⬇️
62+
uses: actions/download-artifact@v2
63+
with:
64+
name: dist
65+
path: dist
66+
67+
- name: Install using ${{ matrix.manager }} ➕
68+
if: "!${{ matrix.extras }}"
69+
run: ${{ matrix.manager }} install "${{ needs.build.outputs.wheel }}"
70+
71+
- name: Install (with [${{ matrix.extras }}] extras) using ${{ matrix.manager }} ➕
72+
if: ${{ matrix.extras }}
73+
run: ${{ matrix.manager }} install "${{ needs.build.outputs.wheel }}[${{ matrix.extras }}]"
74+
75+
- name: "Verify ${{ matrix.extras }} installation (${{ matrix.manager }}) 🖨️"
76+
if: ${{ matrix.manager == 'pip' && matrix.extras && matrix.extras != 'dev' }}
77+
run: ${{ matrix.extras }} --version
78+
79+
- name: "Verify ${{ matrix.extras }} installation (${{ matrix.manager }}) 🖨️"
80+
if: ${{ matrix.manager == 'pipenv' && matrix.extras && matrix.extras != 'dev' }}
81+
run: pipenv run ${{ matrix.extras }} --version
82+
83+
- name: "Verify package installation (${{ matrix.manager }}) 🖨️"
84+
if: ${{ matrix.manager == 'pip' }}
85+
run: pipenv-setup --help
86+
87+
- name: "Verify installation (${{ matrix.manager }}) 🖨️"
88+
if: ${{ matrix.manager == 'pipenv' }}
89+
run: pipenv run pipenv-setup --help

Pipfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ url = "https://pypi.org/simple"
44
verify_ssl = true
55

66
[dev-packages]
7+
black = { markers = "python_version>='3.6'", version = "==19.10b0" }
78
pipenv-setup = { editable = true, path = "." }
89
pytest = { markers = "python_version>='3.6'", version = "~=5.2" }
910
pytest-mypy = { markers = "python_version>='3.5'", version = ">=0.8" }
@@ -16,12 +17,10 @@ types-six = "*"
1617

1718
[packages]
1819
pipfile = "~=0.0"
19-
black = { markers = "python_version>='3.6'", version = "==19.10b0" }
2020
colorama = "~=0.4"
2121
packaging = "~=20.0"
2222
requirementslib = "~=1.5"
2323
vistir = "~=0.4"
24-
autopep8 = { markers = "python_version<'3.6'", version = "~=1.4" }
2524
six = "~=1.12"
2625
typing = { markers = "python_version<'3.7'", version = "~=3.7" }
2726
chardet = ">=3.0.0, <=5.0.0"

0 commit comments

Comments
 (0)