Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2116 #2139

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

#2116 #2139

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
48 changes: 48 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/python
{
"name": "Python 3",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye",
"features": {
"ghcr.io/devcontainers/features/sshd:1": {},
"ghcr.io/va-h/devcontainers-features/uv:1": {},
"ghcr.io/devcontainers-extra/features/ruff:1": {},
"ghcr.io/devcontainers/features/rust": {},
"ghcr.io/devcontainers-extra/features/pre-commit": {}
},
"runArgs": [
// other args
// "--volume=${localWorkspaceFolder}:/workspaces/${localWorkspaceFolderBasename}:Z"
// https://darkghosthunter.medium.com/making-podman-devpod-and-phpstorm-play-nice-5d50318cb212
"--userns=keep-id",
"--security-opt",
"label=disable"
],
"customizations": {
"vscode": {
"extensions": [
"matangover.mypy",
"ktnrg45.vscode-cython",
"ms-vscode.cpptools-extension-pack",
"charliermarsh.ruff",
"donjayamanne.python-extension-pack",
"njpwerner.autodocstring",
"KevinRose.vsc-python-indent",
"tamasfe.even-better-toml",
"usernamehw.errorlens",
"yzhang.markdown-all-in-one"
]
}
},
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "uv sync --all-groups"
// Configure tool-specific properties.
// "customizations": {},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
25 changes: 25 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 22.10.0
hooks:
- id: black
args: [ "--config", "pyproject.toml" ]
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.8.1
hooks:
- id: ruff
args: [ "--config", "pyproject.toml", "--no-fix" ]
- id: ruff-format
args: [ "--config", "pyproject.toml", "--check" ]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.13.0
hooks:
- id: mypy
args: [ "--config-file", "pyproject.toml"]
2 changes: 1 addition & 1 deletion opteryx/__version__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__build__ = 906
__build__ = 908

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
90 changes: 77 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,78 @@
[project]
name = "opteryx"
version = "0.19.0"
readme = "README.md"
requires-python = ">=3.9"
dependencies = [
"aiohttp>=3.11.8",
"cython>=3.0.11",
"numpy==1.*",
"orjson>=3.10.12",
"orso>=0.0.176",
"psutil>=6.1.0",
"pyarrow>=12.0.1",
"pysimdjson>=6.0.2",
"requests>=2.32.3",
]

[build-system]
requires = ["setuptools_rust", "setuptools>=42", "wheel", "Cython", "numpy"]
build-backend = "setuptools.build_meta"


[dependency-groups]
dev = ["setuptools-rust>=1.10.2"]
dev-tests = [
"black>=24.10.0",
"coverage>=7.6.8",
"duckdb>=1.1.3",
"duckdb-engine>=0.13.6",
"fastavro>=1.9.7",
"firestore>=0.0.8",
"google-cloud-bigquery-storage>=2.27.0",
"google-cloud-storage>=2.18.2",
"hypothesis>=6.122.0",
"isort>=5.13.2",
"minio>=7.2.12",
"mypy>=1.13.0",
"pandas>=2.2.3",
"polars>=1.16.0",
"psycopg2-binary>=2.9.10",
"pycln>=2.4.0",
"pymemcache>=4.0.0",
"pymongo>=4.10.1",
"pymysql>=1.1.1",
"pytest>=8.3.3",
"redis>=5.2.0",
"requests>=2.32.3",
"rich>=13.9.4",
"sqlalchemy-cockroachdb>=2.0.2",
"sqlalchemy>=2.0.0",
"types-orjson>=3.6.2",
"types-pyyaml>=6.0.12.20240917",
"types-requests>=2.32.0.20241016",
"zstandard>=0.23.0",
"sqlalchemy-bigquery>=1.12.0",
"pyodbc>=5.2.0",
"cassandra-driver>=3.29.2",
"setuptools-rust>=1.10.2",
"aiohttp>=3.11.8",
"psutil>=6.1.0",
]

[tool.black]
line-length = 100
target-version = ['py310']
fast = true

[tool.isort]
profile = "black"
extend_skip_glob = ["tests/**", "*.pyx", "testdata/**", "**/operators/__init__.py"]
extend_skip_glob = [
"tests/**",
"*.pyx",
"testdata/**",
"**/operators/__init__.py",
]
skip_gitignore = true
line_length = 100
multi_line_output = 9
Expand All @@ -18,18 +85,13 @@ disable = "C0103,C0415"

[tool.mypy]
exclude = ["bench", "#"]
python_version = "3.10"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
show_error_codes = true
no_implicit_optional = true

[tool.bandit]
exclude_dirs = ["**/test_*.py",]
skips = ["B101", "B105", "B324", "B608"]
# B101 - Use of ASSERT
# B105 - Hardcoded passwords
# B324 - Use of weak crypto
# B608 - Hardcoded SQL

[build-system]
requires = ["setuptools>=42", "wheel", "Cython", "numpy"]
build-backend = "setuptools.build_meta"

[tool.ruff]
line-length = 100
Expand All @@ -41,9 +103,11 @@ docstring-code-format = true
docstring-code-line-length = 100

[tool.ruff.lint]
select = ["SIM"]
select = ["F", "E", "W", "I", "D", "SIM", "S", "N", "C", "E", "W"]
ignore = []


[tool.ruff.lint.per-file-ignores]
"**/cost_based_optimizer/**" = ["SIM102"]
"opteryx/managers/expression/ops.py" = ["SIM118"]
"**/test_*.py" = ["S101", "S105", "S324", "S608"]
Loading
Loading