Skip to content
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
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ jobs:
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0 # Needed to fetch the version from git
- uses: actions/setup-python@v4
with:
python-version: "3.13"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ var/
*.egg-info/
.installed.cfg
*.egg
esrally/_version.py # hatch-vcs
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are no inline comments in .gitignore, please move the comment to the previous line.


# PyInstaller
# Usually these files are written by a python script from a template
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,11 @@ it: venv
$(MAKE) test ARGS=$(or $(ARGS),it/)

# It runs serverless integration tests.
it_serverless: install_pytest_rally_plugin
it_serverless: venv install_pytest_rally_plugin
uv run -- pytest -s --log-cli-level=$(LOG_CI_LEVEL) --track-repository-test-directory=it_tracks_serverless it/track_repo_compatibility $(ARGS)

# It runs rally_tracks_compat integration tests.
it_tracks_compat: install_pytest_rally_plugin
it_tracks_compat: venv install_pytest_rally_plugin
uv run -- pytest -s --log-cli-level=$(LOG_CI_LEVEL) it/track_repo_compatibility $(ARGS)

# It runs benchmark tests.
Expand Down
13 changes: 7 additions & 6 deletions docker/Dockerfiles/dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ COPY --from=ghcr.io/astral-sh/uv:0.8.22 /uv /uvx /bin/

USER 1000

COPY Makefile /rally/
COPY README.md /rally/
COPY .ci/variables.json /rally/.ci/
COPY esrally/ /rally/esrally/
COPY pyproject.toml /rally/
COPY uv.lock /rally/
COPY --chown=1000:0 Makefile /rally/
COPY --chown=1000:0 README.md /rally/
COPY --chown=1000:0 .ci/variables.json /rally/.ci/
COPY --chown=1000:0 esrally/ /rally/esrally/
COPY --chown=1000:0 pyproject.toml /rally/
COPY --chown=1000:0 uv.lock /rally/

ENV VIRTUAL_ENV=/rally/venv
ENV PATH=/rally/venv/bin:$PATH
Expand All @@ -52,6 +52,7 @@ ENV UV_PROJECT_ENVIRONMENT=/rally/venv
# Wipe away any lingering caches, copied over from the local machine
RUN find /rally -name "__pycache__" -exec rm -rf -- \{\} \; 2>/dev/null || true
RUN find /rally -name ".pyc" -exec rm -rf -- \{\} \; 2>/dev/null || true
ENV SETUPTOOLS_SCM_PRETEND_VERSION=${RALLY_VERSION}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In dev Docker scripts RALLY_VERSION has unexpected value, see this failure in a test build:

`vcs`: Invalid version: 'refs_pull_2080_head-df58675e-20260331-arm64'

export RALLY_VERSION="${branch_name}-${GIT_SHA}-${DATE}-${ARCH}"

RUN make install

LABEL org.label-schema.schema-version="1.0" \
Expand Down
1 change: 0 additions & 1 deletion esrally/_version.py

This file was deleted.

10 changes: 7 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
[build-system]
requires = ["hatchling"]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[tool.hatch.version]
path = "esrally/_version.py"
source = "vcs"
[tool.hatch.version.raw-options]
local_scheme = "no-local-version"
[tool.hatch.build.hooks.vcs]
version-file = "esrally/_version.py"
Comment on lines 5 to +10
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This instructs hatch and hatch-vcs to create the esrally/_version.py file, using numbers like devN instead of the git hash, as this is the only format that PyPI supports.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add it as a comment. It will help in the future.


[tool.hatch.metadata]
allow-direct-references = true
Expand Down Expand Up @@ -166,7 +170,7 @@ profile = 'black'
# set to true for more verbose output of tests
log_cli = false
log_level = "INFO"
addopts = "--verbose --color=yes"
addopts = "--verbose --color=yes --import-mode=importlib"
testpaths = "tests"
junit_family = "xunit2"
junit_logging = "all"
Expand Down
Loading