-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* 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`
- Loading branch information
1 parent
d3cc76f
commit e04bea6
Showing
7 changed files
with
454 additions
and
302 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
# ------------------------------------------------------------------------------------- | ||
# Summary: Test the external CLI usage of this project. | ||
# Created: 2021-11-20 18:44:48 | ||
# Author: Bryant Finney <[email protected]> (https://bryant-finney.github.io/about) | ||
# ------------------------------------------------------------------------------------- | ||
name: Test Usage | ||
|
||
on: | ||
push: | ||
pull_request: | ||
workflow_dispatch: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build: | ||
name: Build wheel | ||
outputs: | ||
wheel: ${{ steps.build.outputs.wheel }} | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
|
||
- name: Prepare build system | ||
run: pip install --upgrade pip setuptools wheel | ||
|
||
- name: Build wheel and source distribution 🛠️ | ||
id: build | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
echo "::set-output name=wheel::$(ls ./dist/*.whl)" | ||
- name: Upload build artifacts ⬆️ | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: dist | ||
path: dist/*.whl | ||
|
||
test-install: | ||
name: "${{ matrix.os }} | py${{ matrix.py }}: ${{ matrix.manager }} install ${{ needs.build.outputs.wheel }}[${{ matrix.extras }}]" | ||
needs: build | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
extras: ["", "dev", "black", "autopep8"] | ||
manager: [pip, pipenv] | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
py: [3.7, 3.8] | ||
|
||
steps: | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.py }} | ||
|
||
- name: Update ${{ matrix.manager }} | ||
run: echo "${{ matrix.manager }}" | grep pipenv | xargs pip install --upgrade pip | ||
|
||
- name: Download build artifacts ⬇️ | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: dist | ||
path: dist | ||
|
||
- name: Install using ${{ matrix.manager }} ➕ | ||
if: "!${{ matrix.extras }}" | ||
run: ${{ matrix.manager }} install "${{ needs.build.outputs.wheel }}" | ||
|
||
- name: Install (with [${{ matrix.extras }}] extras) using ${{ matrix.manager }} ➕ | ||
if: ${{ matrix.extras }} | ||
run: ${{ matrix.manager }} install "${{ needs.build.outputs.wheel }}[${{ matrix.extras }}]" | ||
|
||
- name: "Verify ${{ matrix.extras }} installation (${{ matrix.manager }}) 🖨️" | ||
if: ${{ matrix.manager == 'pip' && matrix.extras && matrix.extras != 'dev' }} | ||
run: ${{ matrix.extras }} --version | ||
|
||
- name: "Verify ${{ matrix.extras }} installation (${{ matrix.manager }}) 🖨️" | ||
if: ${{ matrix.manager == 'pipenv' && matrix.extras && matrix.extras != 'dev' }} | ||
run: pipenv run ${{ matrix.extras }} --version | ||
|
||
- name: "Verify package installation (${{ matrix.manager }}) 🖨️" | ||
if: ${{ matrix.manager == 'pip' }} | ||
run: pipenv-setup --help | ||
|
||
- name: "Verify installation (${{ matrix.manager }}) 🖨️" | ||
if: ${{ matrix.manager == 'pipenv' }} | ||
run: pipenv run pipenv-setup --help |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.