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
27 changes: 9 additions & 18 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,22 @@ jobs:
python-version: ["3.8", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
python-version: ${{ matrix.python-version }}

- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-test.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Setup java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
java-version: '8'

- name: Install dependencies
run: |
pip install -U pip setuptools
pip install .

if [ -f requirements-test.txt ]; then pip install -r requirements-test.txt; fi
run: |
uv sync

- name: Cache binary versions
id: cache-versions
Expand All @@ -59,6 +49,7 @@ jobs:
- name: Download versions
if: steps.cache-versions.outputs.cache-hit != 'true'
run: |
source ${{ env.VIRTUAL_ENV }}/bin/activate
normalized=$(echo ${{ inputs.reloc_version }} | tr ':' '_')
if [ ! -f ~/.ccm/scylla-repository/unstable/master/$normalized ]; then
./ccm create temp -n 1 --scylla --version unstable/master:${{ inputs.reloc_version }}
Expand All @@ -69,7 +60,7 @@ jobs:

- name: Test with pytest
run: |
python -m pytest ./tests -x
uv run python -m pytest ./tests -x

- name: Copy logs/results
if: contains(github.event.pull_request.labels.*.name, 'PR-upload-log')
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ tests/test_results
.vscode/

.envrc
ccmlib/tests/
ccmlib/tests/

uv.lock
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Requirements
------------

- A working python installation (tested to work with python 3.12).
- `pip install -e .` to install the required dependencies.
- [UV](https://docs.astral.sh/uv)
- Java if cassandra is used or older scylla < 6.0 (which version depends on the version
of Cassandra you plan to use. If unsure, use Java 8 as it is known to
work with current versions of Cassandra).
Expand All @@ -80,9 +80,11 @@ Known issues
Installation
------------

ccm uses python setuptools (with distutils fallback) so from the source directory run:
ccm uses UV with setuptools as a build system (with distutils fallback) so from the source directory run:

sudo ./setup.py install
uv python install
uv venv .venv-ccm
uv sync

ccm is available on the [Python Package Index][pip]:

Expand Down
56 changes: 30 additions & 26 deletions ccm
Original file line number Diff line number Diff line change
Expand Up @@ -40,35 +40,39 @@ def print_global_usage():
exit(1)


common.check_win_requirements()
def main():
common.check_win_requirements()

if len(sys.argv) <= 1:
print("Missing arguments")
print_global_usage()

arg1 = sys.argv[1].lower()

if arg1 in cluster_cmds.cluster_cmds():
kind = 'cluster'
cmd = arg1
cmd_args = sys.argv[2:]
else:
if len(sys.argv) <= 2:
if len(sys.argv) <= 1:
print("Missing arguments")
print_global_usage()
kind = 'node'
node = arg1
cmd = sys.argv[2]
cmd_args = [node] + sys.argv[3:]

cmd = get_command(kind, cmd)
if not cmd:
print("Unknown node or command: {0}".format(arg1))
exit(1)

parser = cmd.get_parser()
arg1 = sys.argv[1].lower()

if arg1 in cluster_cmds.cluster_cmds():
kind = 'cluster'
cmd = arg1
cmd_args = sys.argv[2:]
else:
if len(sys.argv) <= 2:
print("Missing arguments")
print_global_usage()
kind = 'node'
node = arg1
cmd = sys.argv[2]
cmd_args = [node] + sys.argv[3:]

cmd = get_command(kind, cmd)
if not cmd:
print("Unknown node or command: {0}".format(arg1))
exit(1)

parser = cmd.get_parser()

(options, args) = parser.parse_args(cmd_args)
cmd.validate(parser, options, args)

(options, args) = parser.parse_args(cmd_args)
cmd.validate(parser, options, args)
cmd.run()

cmd.run()
if __name__ == '__main__':
main()
60 changes: 60 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
[project]
name = "ccm"
version = "0.1.0"
license = { file = "license.txt"}
description = "Cassandra Cluster Manager"
authors = [
{name = "Sylvain Lebresne", email = "sylvain@datastax.com"}
]
maintainers = [
{name="ScyllaDB Contributors"}
]
readme = "README.md"
requires-python = ">=3.8"
dependencies = [
"ruamel-yaml",
"psutil",
"requests",
"packaging",
"boto3",
"tqdm",
"urllib3 < 2",
]
[project.urls]
Repository = "https://github.com/scylladb/scylla-ccm"
Issues = "https://github.com/scylladb/scylla-ccm/issues"

[project.scripts]
ccm = "ccm:main"

[dependency-groups]
dev = [
"pytest",
"awscli"
]
[tool.setuptools]
packages = ["ccmlib", "ccmlib.cmds", "ccmlib.utils"]

[tool.pytest.ini_options]
python_classes = ["*Test", "Test*"]
python_files = ["test_*", "*_test"]
python_functions = ["test_*", "*_test"]
testpaths = "tests"
norecursedirs = [".*", "ssl", "*.egg-info", "ccmlib", "docs"]
log_cli = true
log_cli_level = "ERROR"
log_level = "DEBUG"
log_format = "%(asctime)s %(levelname)-8s %(message)s"
log_date_format = "%Y-%m-%d %H:%M:%S"
log_file = "tests/test_results/ccm.log"
markers = [
"docker: Run tests with docker image",
"reloc: Run tests with relocatable packages",
"cassandra: Run tests with cassandra binaries",
"repo_tests: Run test for testing get versions"
]
filterwarnings = ["error", "ignore::ResourceWarning"]

[build-system]
requires = ["setuptools >= 61.0"]
build-backend = "setuptools.build_meta"
21 changes: 0 additions & 21 deletions pytest.ini

This file was deleted.

2 changes: 0 additions & 2 deletions requirements-test.txt

This file was deleted.

39 changes: 0 additions & 39 deletions setup.py

This file was deleted.

Loading