Skip to content
Merged
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: 0 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ omit =
# omit everything in /usr
/usr/local/lib/python*
tests/*
setup.py

branch = True
3 changes: 1 addition & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ include CONTRIBUTING.md
include LICENSE
include MANIFEST.in
include README.md
include setup.py
include version.txt
include osbenchmark/min-os-version.txt
include osbenchmark/min-version.txt
recursive-include docs *
recursive-include osbenchmark/resources *
# recursive-exclude * __pycache__
Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ python-caches-clean:
-@find . -name "__pycache__" -prune -exec rm -rf -- \{\} \;
-@find . -name ".pyc" -prune -exec rm -rf -- \{\} \;

# Note: pip will not update project dependencies (specified either in the install_requires or the extras
# section of the setup.py) if any version is already installed; therefore we recommend
# recreating your environments whenever your project dependencies change.
# Note: pip will not update project dependencies (specified in pyproject.toml) if any version is
# already installed; therefore we recommend recreating your environments whenever your project
# dependencies change.
tox-env-clean:
rm -rf .tox

Expand All @@ -83,18 +83,18 @@ test: develop
pytest tests/

it: pyinst check-java python-caches-clean tox-env-clean
@which tox || $(PIP) install tox
@tox --version 2>/dev/null | grep -qE '^[4-9]\.' || $(PIP) install "tox>=4"
tox
Comment thread
janhoy marked this conversation as resolved.

it312 it313: pyinst check-java python-caches-clean tox-env-clean
@which tox || $(PIP) install tox
@tox --version 2>/dev/null | grep -qE '^[4-9]\.' || $(PIP) install "tox>=4"
tox -e $(@:it%=py%)
Comment thread
janhoy marked this conversation as resolved.

benchmark:
pytest benchmarks/

coverage:
coverage run setup.py test
coverage run -m pytest tests/
coverage html

release-checks:
Expand Down
6 changes: 2 additions & 4 deletions PYTHON_SUPPORT_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ Make changes to the following files and open a PR titled
* `.ci/variables.json`: Update Python variables and `MIN_PY_VER` as needed.
For example: to add Python `3.13`, ensure there is a `PY313` variable set
to the latest patch release such as `3.13.1`.
* `.github/workflows/integ-tests.yml`: Update supported Python versions in
the `python-versions` section.
* `setup.py`: Update `supported_python_versions`.
* `tox.ini`: Update `env_list`.
* `pyproject.toml`: Update `requires-python` and the `classifiers` list under `[project]`.
* `pyproject.toml`: Update `envlist` in the `[tool.tox]` `legacy_tox_ini` section.
* `Makefile`: If updating the minimum supported Python version, update the
`pyinst<MIN_VERSION>` target and `check-pip`:

Expand Down
215 changes: 215 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

[build-system]
requires = ["setuptools>=68", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "solr-orbit"
dynamic = ["version"]
description = "Macrobenchmarking framework for Apache Solr"
readme = {file = "README.md", content-type = "text/markdown"}
license = {text = "Apache License, Version 2.0"}
Comment thread
janhoy marked this conversation as resolved.
requires-python = ">=3.12,<3.14"
classifiers = [
"Topic :: System :: Benchmark",
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: Apache Software License",
"Intended Audience :: Developers",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
dependencies = [
# License: BSD
# Solr HTTP client for data operations (indexing, search, commit, optimize)
"pysolr>=3.10.0",
# License: Apache 2.0
# HTTP client for Solr V2 API admin operations
# transitive dependencies:
# urllib3: MIT
"requests>=2.28.0",
# License: BSD
"psutil>=5.8.0",
# License: MIT
"py-cpuinfo>=7.0.0",
# License: MIT
"tabulate>=0.9.0",
# License: MIT
"jsonschema>=3.1.1",
# License: BSD
"Jinja2>=3.1.3",
# License: BSD
"markupsafe>=2.0.1",
# License: MIT
# With 3.10.7, we get InvalidActorAddress exception while initialize Actor
"thespian>=3.10.1,<3.10.7",
# always use the latest version, these are certificate files...
# License: MPL 2.0
"certifi",
# License: Apache 2.0
"yappi>=1.4.0",
# License: BSD
"ijson>=2.6.1",
# License: Apache 2.0
# transitive dependencies:
# google-crc32c: Apache 2.0
"google-resumable-media>=1.1.0",
# License: Apache 2.0
"google-auth>=1.22.1",
# License: MIT
"wheel>=0.38.4",
# License: Apache 2.0
# transitive dependencies:
# botocore: Apache 2.0
# jmespath: MIT
# s3transfer: Apache 2.0
"boto3>=1.28.62",
# Licence: BSD-3-Clause
"zstandard>=0.22.0",
# License: BSD
# Required for knnvector workload
"h5py>=3.10.0",
# License: BSD
# Required for knnvector workload
"numpy>=1.24.2,<=1.26.4",
# License: MIT
"tqdm",
# License: MIT
"faker",
# License: BSD
"pandas>=1.4.3",
# License: MIT
"mimesis==11.1.0",
# Licence: BSD-3-Clause
"dask",
# Licence: BSD-3-Clause
"dask[distributed]",
# Licence: BSD-3-Clause
"bokeh!=3.0.*,>=2.4.2",
# License: MIT
"pydantic>=2.10.6",
# License: MIT
"pydantic_core>=2.27.2",
# License: MIT
"PyYAML>=5.4",
]

[project.urls]
Homepage = "https://github.com/apache/solr-orbit"

[project.scripts]
solr-orbit = "osbenchmark.benchmark:main"
solr-orbitd = "osbenchmark.benchmarkd:main"

[project.optional-dependencies]
test = [
"ujson",
"pytest==7.2.2",
# Upgraded from 3.2.2: py.io.TerminalWriter was removed in py 1.11+,
# making 3.x incompatible with Python 3.12. 4.0+ dropped the py dependency.
"pytest-benchmark>=4.0.0",
"pytest-asyncio==0.14.0",
]
develop = [
"ujson",
"pytest==7.2.2",
# Upgraded from 3.2.2: py.io.TerminalWriter was removed in py 1.11+,
# making 3.x incompatible with Python 3.12. 4.0+ dropped the py dependency.
"pytest-benchmark>=4.0.0",
Comment thread
janhoy marked this conversation as resolved.
Comment thread
janhoy marked this conversation as resolved.
"pytest-asyncio==0.14.0",
"tox>=4.0",
"coverage==5.5",
"twine==6.0.1",
Comment thread
janhoy marked this conversation as resolved.
"wheel>=0.38.4",
"github3.py==1.3.0",
"pylint==3.3.9",
]

# ---------------------------------------------------------------------------
# Setuptools configuration
# ---------------------------------------------------------------------------

[tool.setuptools]
include-package-data = true
script-files = ["scripts/expand-data-corpus.py"]

[tool.setuptools.packages.find]
where = ["."]
exclude = ["tests*", "benchmarks*", "it*"]

[tool.setuptools.package-data]
"*" = ["*.json", "*.yml"]

[tool.setuptools.dynamic]
version = {file = "version.txt"}

# ---------------------------------------------------------------------------
# pytest
# ---------------------------------------------------------------------------

[tool.pytest.ini_options]
log_cli = false
log_level = "INFO"
addopts = "--verbose --color=yes"
testpaths = ["tests"]
junit_family = "xunit2"
junit_logging = "all"

# ---------------------------------------------------------------------------
# tox
# ---------------------------------------------------------------------------

[tool.tox]
legacy_tox_ini = """
[tox]
envlist =
py312,py313
platform =
linux|darwin

[testenv]
deps=
pytest
passenv =
HOME
JAVA*_HOME
BENCHMARK_HOME
SSH_AUTH_SOCK
THESPLOG_FILE
THESPLOG_FILE_MAXSIZE
THESPLOG_THRESHOLD
# we do not pass LANG and LC_ALL anymore in order to isolate integration tests
# from the test environment. OSBenchmark needs to enforce UTF-8 encoding in every
# place so we intentionally set LC_ALL to C.
setenv =
LC_ALL=C
# According to http://pubs.opengroup.org/onlinepubs/7908799/xbd/envvar.html
# LC_ALL should have priority but to ensure that non-confirming
# applications behave identically, we also set LANG explicitly.
LANG=C
commands =
python -V
pytest -s it --junitxml=junit-{envname}-it.xml

allowlist_externals =
pytest
"""
11 changes: 5 additions & 6 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,14 @@
readonly BINARY_NAME="${__BENCHMARK_INTERNAL_BINARY_NAME}"
readonly HUMAN_NAME="${__BENCHMARK_INTERNAL_HUMAN_NAME}"

install_osbenchmark_with_setuptools () {
install_osbenchmark () {
# Check if optional parameter with benchmark binary path, points to an existing executable file.
if [[ $# -ge 1 && -n $1 ]]; then
if [[ -f $1 && -x $1 ]]; then return; fi
fi

# Workaround system pip conflicts, https://github.com/pypa/pip/issues/5599
if [[ ${IN_VIRTUALENV} == 0 ]]; then
# https://setuptools.readthedocs.io/en/latest/setuptools.html suggests not invoking setup.py directly
# Also workaround system pip conflicts, https://github.com/pypa/pip/issues/5599
python3 -m pip install --quiet --user --upgrade --editable .[develop]
else
python3 -m pip install --quiet --upgrade --editable .[develop]
Expand Down Expand Up @@ -99,7 +98,7 @@ then
then
echo "Auto-updating solr-orbit from ${REMOTE}"
git rebase ${REMOTE}/master --quiet
install_osbenchmark_with_setuptools
install_osbenchmark
#else
# offline - skipping update
fi
Expand All @@ -125,14 +124,14 @@ if [[ $IN_VIRTUALENV == 0 ]]
then
BENCHMARK_ROOT=$(python3 -c "import site; print(site.USER_BASE)")
BENCHMARK_BIN=${BENCHMARK_ROOT}/bin/${BINARY_NAME}
install_osbenchmark_with_setuptools "${BENCHMARK_BIN}"
install_osbenchmark "${BENCHMARK_BIN}"
if [[ -x $BENCHMARK_BIN ]]; then
${BENCHMARK_BIN} "$@"
else
echo "Cannot execute ${HUMAN_NAME} in ${BENCHMARK_BIN}."
fi
else
install_osbenchmark_with_setuptools "${BINARY_NAME}"
install_osbenchmark "${BINARY_NAME}"

${BINARY_NAME} "$@"
fi
11 changes: 0 additions & 11 deletions setup.cfg

This file was deleted.

Loading
Loading