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
5 changes: 1 addition & 4 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,4 @@ formats: []
# Optionally declare the Python requirements required to build your docs
python:
install:
- method: pip
path: .
extra_requirements:
- docs
- requirements: docs/requirements.txt
Comment thread
StephenSorriaux marked this conversation as resolved.
71 changes: 52 additions & 19 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,49 +14,83 @@ IRC in the

## Development

### Clone the repo

If you want to work on the code and send us a
[pull request](https://help.github.com/articles/using-pull-requests),
first fork the repository on github to your own account. Then clone
your new repository and run the build scripts:
first fork the repository on github to your own account, then clone your new repository.

```
```bash
git clone git@github.com:<username>/kazoo.git
cd kazoo
make
```

You need a supported version of Python installed and available as `python`
in your shell. To run Zookeeper you also need a Java runtime (JRE or JDK).
Please refer to the Zookeeper documentation for compatible Java versions for
each Zookeeper version. To run tests, you need to have `tox`, the Python
testing tool, installed in your shell.
### Install required utilities, zookeeper and support libraries

You'll also need some other libraries and utilities installed in order to run tests.

1. A supported version of python and its -dev package (again, apt install should work).
2. Zookeeper.
3. In order to run Zookeeper, you'll need a Java runtime (JRE or JDK). Please refer to the Zookeeper documentation for compatible Java versions for each Zookeeper version.
4. libkrb5-dev for kerberos authentication if you're connecting to Zookeeper with sasl (apt install should work for this)
5. Optionally pypy3. This is a little more complex to install. Something like the following should work
- `add-apt-repository ppa:pypy/ppa && sudo apt update && sudo apt install pypy3 pypy3-dev`
6. tox

### Create a virtual env and populate it

You can run all the tests by calling:
```bash
python -m venv venv
source venv/bin/activate
pip install --upgrade pip setuptools wheel tox
pip install -e .
```

If you want to support eventlet, gevent, or sasl replace the last with (or an appropriate variant)

```bash
pip install -e ".[eventlet,gevent,sasl]"
```
make test

If you want to install the tools used by tox so you can use them yourself, also run (for python 3.9 and above only). For python 3.8, sadly, you'll have to read the pyproject.toml file and manually install.

```bash
pip install --group <toolname>
```

Or to run individual tests:
### Running validations

To run all the validations (tests, formatting checks and so on), run

```bash
tox
```
export ZOOKEEPER_PATH=/<path to current folder>/bin/zookeeper/
bin/pytest -v kazoo/tests/test_client.py::TestClient::test_create

To run all the tests, use

```bash
tox -e py
```

Or to run individual tests:

```bash
export ZOOKEEPER_PATH=/<path to current folder>/bin/zookeeper/
bin/pytest -v kazoo/tests/test_client.py::TestClient::test_create
```

The pytest test runner allows you to filter by test module, class or
individual test method.

If you made changes to the documentation, you can build it locally:

```
make html
```bash
tox -e docs
```

And then open `./docs/_build/html/index.html` in a web browser to
And then open `.tox//docs/_build/html/index.html` in a web browser to
verify the correct rendering.


## Bug Reports

You can file issues here on GitHub. Please try to include as much information as
Expand Down Expand Up @@ -94,7 +128,6 @@ When submitting a PR:
- Please do not include merge commits in pull requests; include only commits
with the new relevant code.


## Code Review

This project is production Mozilla code and subject to our [engineering practices and quality standards](https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Committing_Rules_and_Responsibilities). Every patch must be peer reviewed.
Expand Down
17 changes: 0 additions & 17 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,21 +1,4 @@
global-exclude *pyc *pyo __pycache__
# Git files
exclude .gitignore
# CI/CD files
exclude .travis.yml.bak
exclude .clog.toml
prune .github

exclude Makefile
exclude run_failure.py

include CHANGES.md
include CONTRIBUTING.md
include README.md
include LICENSE
include MANIFEST.in

include tox.ini

recursive-include kazoo *
recursive-include docs *
51 changes: 0 additions & 51 deletions Makefile

This file was deleted.

19 changes: 0 additions & 19 deletions constraints.txt

This file was deleted.

2 changes: 2 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Sphinx>=1.2.2
sphinx-autodoc-typehints>=1
95 changes: 94 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,102 @@
[build-system]
build-backend = 'setuptools.build_meta'
requires = [
'setuptools >= 46.4.0',
'setuptools >= 61.0.0',
]

[project]
name = "kazoo"
dynamic = ["version", "readme"]
description = "Higher Level Zookeeper Client"
requires-python = ">=3.8"
license = {text = "Apache 2.0"}
authors = [
{name = "Kazoo team", email = "python-zk@googlegroups.com"},
]
keywords = ["zookeeper", "lock", "leader", "configuration"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: Apache Software License",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Communications",
"Topic :: System :: Distributed Computing",
"Topic :: System :: Networking",
]
dependencies = ["typing-extensions>=4.13.2"]

[project.urls]
Comment thread
StephenSorriaux marked this conversation as resolved.
Homepage = "https://kazoo.readthedocs.io"
Documentation = "https://kazoo.readthedocs.io"
Changelog = "https://github.com/python-zk/kazoo/releases"
Source = "https://github.com/python-zk/kazoo"
"Bug Tracker" = "https://github.com/python-zk/kazoo/issues"

[project.optional-dependencies]
eventlet = ["eventlet>=0.17.1; implementation_name != 'pypy'"]
gevent = ["gevent>=1.2; implementation_name != 'pypy'"]
sasl = ["pure_sasl>=0.5.1"]

[dependency-groups]
black = ["black==22.10.0"]
pep8 = ["flake8==5.0.2"]
test-extras = [
"objgraph==3.5.0",
"pyOpenSSL<26.2.0",
"pyjks",
"unittest-parametrize",
]
pytest = [
"pytest==7.4.4; python_version == '3.8'",
"pytest==8.4.2; python_version > '3.8'",
]
test = [
"coverage==6.3.2; python_version == '3.8'",
"coverage==7.10.7; python_version > '3.8'",
{include-group = "pytest"},
"pytest-cov==3.0.0; python_version == '3.8'",
"pytest-cov==7.0.0; python_version > '3.8'",
"pytest-timeout==2.2.0; python_version == '3.8'",
"pytest-timeout==2.4.0; python_version > '3.8'",
{include-group = "test-extras"},
]
typing = [
"mypy==1.14.1",
"types-gevent",
"types-mock",
"types-objgraph",
"types-pyjks",
]
mypy = [
Comment thread
StephenSorriaux marked this conversation as resolved.
{include-group = "typing"},
{include-group = "test-extras"},
{include-group = "pytest"},
]

[tool.setuptools]
zip-safe = false
include-package-data = true
packages = {find = {}}
license-files = ["LICENSE"]
Comment thread
StephenSorriaux marked this conversation as resolved.

[tool.setuptools.package-data]
kazoo = ["py.typed"]

[tool.setuptools.dynamic]
version = {attr = "kazoo.version.__version__"}
readme = {file = ["README.md", "CHANGES.md", "CONTRIBUTING.md"], content-type = "text/markdown"}

[tool.black]
line-length = 79
# We need a later version of black for 312-314
Expand Down
Loading
Loading