diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index b12aea445a..393ab84f4b 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -14,16 +14,16 @@ jobs:
fail-fast: false
matrix:
include:
- - {name: Windows, python: '3.12', os: windows-latest, tox: fail_fast_test_main}
- # - {name: Mac, python: '3.12', os: macos-latest, tox: fail_fast_test_main}
- - { name: "ruff", python: "3.11", os: ubuntu-latest, tox: "ruff" }
- - { name: "mypy", python: "3.10", os: ubuntu-latest, tox: "mypy" }
+ - {name: Windows, python: '3.12', os: windows-latest, tox: fail_fast_test_main, skip_pre_build: "true" }
+ # - {name: Mac, python: '3.12', os: macos-latest, tox: fail_fast_test_main, skip_pre_build: "false" }
+ - { name: "ruff", python: "3.11", os: ubuntu-latest, tox: "ruff", skip_pre_build: "false" }
+ - { name: "mypy", python: "3.10", os: ubuntu-latest, tox: "mypy", skip_pre_build: "false" }
# run some integration tests and abort immediately if they fail, for faster feedback
- - { name: "Linux", python: "3.12", os: ubuntu-latest, tox: fail_fast_test_main }
- - { name: "3.12", python: "3.12", os: ubuntu-latest, tox: py312 }
- - { name: "3.11", python: "3.11", os: ubuntu-latest, tox: py311 }
- - { name: "3.10", python: "3.10", os: ubuntu-latest, tox: py310 }
- - { name: "3.9", python: "3.9", os: ubuntu-latest, tox: py39 }
+ - { name: "Linux", python: "3.12", os: ubuntu-latest, tox: fail_fast_test_main, skip_pre_build: "false" }
+ - { name: "3.12", python: "3.12", os: ubuntu-latest, tox: py312, skip_pre_build: "false" }
+ - { name: "3.11", python: "3.11", os: ubuntu-latest, tox: py311, skip_pre_build: "false" }
+ - { name: "3.10", python: "3.10", os: ubuntu-latest, tox: py310, skip_pre_build: "false" }
+ - { name: "3.9", python: "3.9", os: ubuntu-latest, tox: py39, skip_pre_build: "false" }
steps:
- uses: actions/checkout@v4
@@ -46,7 +46,7 @@ jobs:
- name: Install poetry plugin
run: python -m poetry self add "poetry-dynamic-versioning[plugin]"
# Install test dependencies (tox) to the root (non-package install)
- - name: Install dependencies
+ - name: Install test dependencies
run: |
python -m poetry install --no-root --only test
- name: set full Python version in PY env var
@@ -60,11 +60,23 @@ jobs:
- name: Install Yarn
run: npm install -g yarn
# Build and install the package if it's Windows, to service shell-based tests
- - if: ${{ matrix.os }} == "windows-latest"
+ - name: Install binary on Windows
+ if: ${{ matrix.os == 'windows-latest' }}
+ env:
+ SKIP_PRE_BUILD: true
+ # Make `locust` available on the Windows shell by installing it with `pip`
+ # before running tests which invoke it in the `cmd` prompt
run: |
python -m poetry build
- pip install --find-links=dist locust
- - run: python -m poetry run tox -e ${{ matrix.tox }}
+ python -m poetry self add "poetry-plugin-export"
+ python -m poetry export --without-hashes --format=requirements.txt > requirements.txt
+ pip install -r requirements.txt
+ pip install poetry-core>=1.0.0
+ pip install locust --find-links=dist
+ - name: Run tox tests
+ env:
+ SKIP_PRE_BUILD: ${{ matrix.skip_pre_build }}
+ run: python -m poetry run tox -e ${{ matrix.tox }}
lint_typecheck_test_webui:
runs-on: ubuntu-latest
diff --git a/Makefile b/Makefile
index 8e53ffc3f1..3598beb357 100644
--- a/Makefile
+++ b/Makefile
@@ -29,7 +29,7 @@ release: build
twine upload dist/*
setup_docs_dependencies:
- poetry install --with docs
+ SKIP_PRE_BUILD=true poetry install --with docs
build_docs: setup_docs_dependencies
sphinx-build -b html docs/ docs/_build/
diff --git a/docs/developing-locust.rst b/docs/developing-locust.rst
index 47644cf519..958ace6e45 100644
--- a/docs/developing-locust.rst
+++ b/docs/developing-locust.rst
@@ -11,19 +11,22 @@ Install Locust for development
Fork Locust on `GitHub `_ and then run
+.. note::
+ To build the Locust web UI, you must have `node` and `yarn` installed - see the *Making changes to Locust's Web UI* section below
+
.. code-block:: sh
# clone the repo
$ git clone git://github.com//locust.git
# install the poetry build system
- $ pip3 install poetry
+ $ python -m pip install poetry
# install the dynamic versioning plugin for poetry
- $ pip3 -m poetry self add "poetry-dynamic-versioning[plugin]"
+ $ poetry self add "poetry-dynamic-versioning[plugin]"
# perform an editable install of the "locust" package
- $ pip3 -m poetry install --with dev
+ $ poetry install --with dev,test
Now the ``locust`` command will run *your* code with no need for reinstalling after making changes.
@@ -40,8 +43,7 @@ We use `tox `_ to automate tests across m
.. code-block:: console
- $ pip3 install tox
- $ tox
+ $ poetry run tox
...
py39: install_deps> python -I -m pip install cryptography mock pyquery retry
py39: commands[0]> python3 -m pip install .
@@ -62,15 +64,14 @@ Locust uses `ruff `_ for formatting and lint
.. code-block:: console
- $ pip3 install ruff
- $ python -m ruff --fix
- $ python -m ruff format
+ $ poetry run ruff --fix
+ $ poetry run ruff format
You can validate the whole project using tox:
.. code-block:: console
- $ tox -e ruff
+ $ poetry run tox -e ruff
ruff: install_deps> python -I -m pip install ruff==0.1.13
ruff: commands[0]> ruff check .
ruff: commands[1]> ruff format --check
@@ -87,7 +88,7 @@ The documentation source is in the `docs/