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

Remove tox and use poe for task execution instead #867

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: ./.github/workflows/validation.yml

unit-tests:
uses: ./.github/workflows/tox-test.yml
uses: ./.github/workflows/test.yml

# Produce a pull request payload artifact with various data about the
# pull-request event (such as the PR number, title, author, ...).
Expand Down
23 changes: 11 additions & 12 deletions .github/workflows/tox-test.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Tox test
name: Test

on: workflow_call

jobs:
tox-test:
test:
runs-on: ${{ matrix.platform }}

strategy:
Expand All @@ -20,21 +20,20 @@ jobs:
id: poetry_setup
uses: ItsDrike/setup-poetry@v1
with:
install-args: "--with workflow-tox --without lint"
install-args: "--without lint"
python-version: "${{ matrix.python-version }}"

- name: Test with tox
- name: Run unit tests
shell: bash
run: poetry run tox
env:
PIP_USER: 0 # We want tox to use it's environments, not user installs
run: poetry run poe test

# This job is used purely to provide a workflow status, which we can mark as a
# required action in branch protection rules. This is a better option than marking
# the tox-test jobs manually, since their names cnange as the supported python
# versions change. This job provides an easy single action that can be marked required.
# This job is used purely to provide a workflow status, which we can mark as
# a required action in branch protection rules. This is a better option than
# marking the test jobs manually, since their names cnange as the supported
# python versions change. This job provides an easy single action that can be
# marked required.
tests-done:
needs: [tox-test]
needs: [test]
if: always() && !cancelled()
runs-on: ubuntu-latest

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![current PyPI version](https://img.shields.io/pypi/v/mcstatus.svg)](https://pypi.org/project/mcstatus/)
[![Docs](https://img.shields.io/readthedocs/mcstatus?label=Docs)](https://mcstatus.readthedocs.io/)
[![Validation](https://github.com/py-mine/mcstatus/actions/workflows/validation.yml/badge.svg)](https://github.com/py-mine/mcstatus/actions/workflows/validation.yml)
[![Tox test](https://github.com/py-mine/mcstatus/actions/workflows/tox-test.yml/badge.svg)](https://github.com/py-mine/mcstatus/actions/workflows/tox-test.yml)
[![Test](https://github.com/py-mine/mcstatus/actions/workflows/test.yml/badge.svg)](https://github.com/py-mine/mcstatus/actions/workflows/test.yml)

Mcstatus provides an API and command line script to fetch publicly available data from Minecraft servers. Specifically, mcstatus retrieves data by using these protocols: [Server List Ping](https://wiki.vg/Server_List_Ping) and [Query](https://wiki.vg/Query). Because of mcstatus, you do not need to fully understand those protocols and can instead skip straight to retrieving minecraft server data quickly in your own programs.

Expand Down
39 changes: 18 additions & 21 deletions docs/pages/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ Setup

pipx install poetry
pipx inject poetry poetry-dynamic-versioning
pipx install tox
pipx inject tox tox-poetry
poetry install --with=docs
poetry run pre-commit install

In addition to those tools, you may also want to install flake8 and black
plugins for your IDE.
In addition to those tools, you may also want to install plugins for your IDE that interact with flake8, pyright, and ruff.

Expectations
------------
Expand All @@ -35,32 +33,31 @@ Once you have all the checks passing and any new behavior changes are tested,
feel free to open a pull request. Pull requests are how GitHub allows forks to
submit branches for consideration to be merged into the original repo.

Running all the checks
----------------------

.. code-block:: sh

tox

Running a specific list of checks
---------------------------------
Common development tasks
------------------------

.. code-block:: sh

tox -e lint,py37,py38
poetry shell # Activates the poetry virtual environment to avoid `poetry run` in front of every command
poe docs # Renders documentation from docs/ folder
poe format # Executes automatic formatter for style consistency
poe lint # Executes linting tools that help increase code quality
poe test # Executes unit tests

Listing all the specific names that can be passed to ``-e``
-----------------------------------------------------------
Listing available tasks
-----------------------

.. code-block:: sh

tox -a
poe

Being fancy with pytest
-----------------------
Being fancy with tasks
----------------------

Any options you want to pass directly to pytest can be done after a double dash ``--``:
You may pass extra arguments to the underlying tasks. Here's an example that
tells the underlying ``pytest`` to execute only the query tests with maximum
verbosity.

.. code-block:: sh

tox -e py37 -- -vvv -k TestQuery
poe test -vvv -k TestQuery
Loading
Loading