From cb2f86bc9ea6458aaf3a9085a8c0e0ade7e3ed0f Mon Sep 17 00:00:00 2001 From: Kye Date: Tue, 5 Mar 2024 12:20:01 -0800 Subject: [PATCH] [TOML CLEANUP] --- Makefile | 20 +++++++++---------- pyproject.toml | 16 ++++++++++----- .../swarms_core}/__init__..py | 0 python/swarms_core/_main.py | 0 4 files changed, 21 insertions(+), 15 deletions(-) rename {swarms_core => python/swarms_core}/__init__..py (100%) create mode 100644 python/swarms_core/_main.py diff --git a/Makefile b/Makefile index 827061c..186627f 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ .DEFAULT_GOAL := all -sources = python/pydantic_core tests generate_self_schema.py wasm-preview/run_tests.py +sources = python/swarms_core tests generate_self_schema.py wasm-preview/run_tests.py -mypy-stubtest = python -m mypy.stubtest pydantic_core._pydantic_core --allowlist .mypy-stubtest-allowlist +mypy-stubtest = python -m mypy.stubtest swarms_core._main --allowlist .mypy-stubtest-allowlist # using pip install cargo (via maturin via pip) doesn't get the tty handle # so doesn't render color without some help @@ -28,7 +28,7 @@ install-rust-coverage: .PHONY: build-dev build-dev: - @rm -f python/pydantic_core/*.so + @rm -f python/swarms_core/*.so ifneq ($(USE_MATURIN),) maturin develop else @@ -37,7 +37,7 @@ endif .PHONY: build-prod build-prod: - @rm -f python/pydantic_core/*.so + @rm -f python/swarms_core/*.so ifneq ($(USE_MATURIN),) maturin develop --release else @@ -46,7 +46,7 @@ endif .PHONY: build-profiling build-profiling: - @rm -f python/pydantic_core/*.so + @rm -f python/swarms_core/*.so ifneq ($(USE_MATURIN),) maturin develop --profile profiling else @@ -55,7 +55,7 @@ endif .PHONY: build-coverage build-coverage: - @rm -f python/pydantic_core/*.so + @rm -f python/swarms_core/*.so ifneq ($(USE_MATURIN),) RUSTFLAGS='-C instrument-coverage' maturin develop --release else @@ -64,7 +64,7 @@ endif .PHONY: build-pgo build-pgo: - @rm -f python/pydantic_core/*.so + @rm -f python/swarms_core/*.so $(eval PROFDATA := $(shell mktemp -d)) ifneq ($(USE_MATURIN),) RUSTFLAGS='-Cprofile-generate=$(PROFDATA)' maturin develop --release @@ -99,7 +99,7 @@ lint-python: ruff check $(sources) ruff format --check $(sources) $(mypy-stubtest) - griffe dump -f -d google -LWARNING -o/dev/null python/pydantic_core + griffe dump -f -d google -LWARNING -o/dev/null python/swarms_core .PHONY: lint-rust lint-rust: @@ -126,7 +126,7 @@ testcov: build-coverage coverage run -m pytest coverage report coverage html -d htmlcov/python - coverage-prepare html python/pydantic_core/*.so + coverage-prepare html python/swarms_core/*.so .PHONY: all all: format build-dev lint test @@ -161,4 +161,4 @@ clean: rm -f .coverage.* rm -rf build rm -rf perf.data* - rm -rf python/pydantic_core/*.so \ No newline at end of file + rm -rf python/swarms_core/*.so \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 7ab1020..3bd28e3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ build-backend = 'maturin' [tool.poetry] name = "swarms-core" -version = "0.0.1" +version = "0.0.2" description = "Swarms Core - Python" license = "MIT" authors = ["Kye Gomez "] @@ -46,7 +46,12 @@ Source = 'https://github.com/kyegomez/swarms-core' [tool.poetry.dependencies] python = "^3.6" swarms = "*" -zetascale = "*" + +[tool.poetry.dev-dependencies] +pytest = "^6.2.4" +pytest-benchmark = "^3.4.1" +maturin = "*" + [tool.poetry.group.lint.dependencies] ruff = "^0.1.6" @@ -79,9 +84,10 @@ preview = true [tool.maturin] python-source = "python" -module-name = "pydantic_core._pydantic_core" +module-name = "swarms_core._main" bindings = 'pyo3' features = ["pyo3/extension-module"] +include = [{ path = "path/**/*", format = "sdist" }] [tool.ruff.lint] extend-select = ['Q', 'RUF100', 'C90', 'I'] @@ -90,7 +96,7 @@ extend-ignore = [ ] flake8-quotes = {inline-quotes = 'single', multiline-quotes = 'double'} mccabe = { max-complexity = 13 } -isort = { known-first-party = ['pydantic_core', 'tests'] } +isort = { known-first-party = ['swarms_core', 'tests'] } [tool.ruff.format] quote-style = 'single' @@ -109,7 +115,7 @@ addopts = [ ] [tool.coverage.run] -source = ['pydantic_core'] +source = ['swarms_core'] branch = true [tool.coverage.report] diff --git a/swarms_core/__init__..py b/python/swarms_core/__init__..py similarity index 100% rename from swarms_core/__init__..py rename to python/swarms_core/__init__..py diff --git a/python/swarms_core/_main.py b/python/swarms_core/_main.py new file mode 100644 index 0000000..e69de29