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

Tooling fixes #108

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# EditorConfig coding styles definitions. For more information about the
# properties used in this file, please see the EditorConfig documentation:
# http://editorconfig.org/

root = true

[*]
charset = utf-8
end_of_line = LF
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.{yml,json}]
indent_size = 2
indent_style = space

[*.{md,diff}]
trim_trailing_whitespace = false
14 changes: 1 addition & 13 deletions .github/actions/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,10 @@ runs:
run: echo "version=$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")" >> $GITHUB_OUTPUT
shell: bash

- name: Bootstrap poetry
run: curl -sL https://install.python-poetry.org | python - -y
shell: bash

- name: Update PATH
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
shell: bash

- name: Configure poetry
run: poetry config virtualenvs.in-project true
shell: bash

- name: Set up cache
uses: actions/cache@v3
id: cache
Expand All @@ -38,9 +30,5 @@ runs:

- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
run: timeout 10s poetry run pip --version || rm -rf .venv
shell: bash

- name: Install Dependencies
run: poetry install
run: timeout 10s pip --version || rm -rf .venv
shell: bash
20 changes: 4 additions & 16 deletions .github/workflows/stability.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,16 @@ jobs:
uses: ./.github/actions

- name: Install tools
run: poetry install --only dev
run: pip install -r dev_requirements.txt

- id: ruff
if: always()
<<<<<<< HEAD
run: poetry run ruff --format=github python_package/surrealdb/
run: ruff check --output-format=github surrealdb/

- id: Black
if: always()
run: poetry run black python_package/surrealdb/ --check --verbose --diff --color
run: black surrealdb/ --check --verbose --diff --color
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be ruff format, no one uses black anymore.


- id: mypy
if: always()
run: poetry run mypy python_package/surrealdb/
=======
run: poetry run ruff check surrealdb/

- id: Black
if: always()
run: poetry run black surrealdb/ --check --verbose --diff --color

- id: mypy
if: always()
run: poetry run mypy surrealdb/
>>>>>>> 89bdd361d0a92f69deff137958279ab21161f00c
run: mypy surrealdb/
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ venv.bak/
bin/
lib64
pyvenv.cfg
.mise.toml

# Unit test / coverage reports
htmlcov/
Expand Down
5 changes: 4 additions & 1 deletion dev_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@ pydantic==1.10.9
semantic-version==2.10.0
setuptools-rust==1.6.0
sniffio==1.3.0
typing_extensions==4.6.3
typing-extensions==4.6.3
websockets==10.4
ruff==0.1.7
black==23.3.0
mypy==1.4.1
751 changes: 0 additions & 751 deletions poetry.lock

This file was deleted.

90 changes: 90 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,92 @@
[build-system]
requires = ["setuptools", "wheel", "setuptools-rust"]

[tool.black]
line-length = 88
color = true

exclude = '''
/(
\.bzr
| \.direnv
| \.eggs
| \.git
| \.hg
| \.mypy_cache
| \.nox
| \.pants\.d
| \.ruff_cache
| \.__pypackages__
| \.svn
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
| env
| venv
)/
'''

[tool.ruff]
select = ["I", "D", "N", "UP"]
line-length = 88

ignore = [
"D100", # Missing docstring in public module
"D104", # Missing docstring in public package
"D107", # Missing docstring in __init__
"D205", # 1 blank line required between summary line and description
"D212", # Multi-line docstring summary should start at the first line
"N805", # First argument of a method should be named self
"N818", # Exception name ... should be named with an Error suffix
"UP035" # Typing deprecations
]

exclude = [
".bzr",
".direnv",
".eggs",
".git",
".hg",
".mypy_cache",
".nox",
".pants.d",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
".git",
"__pycache__",
]

[tool.ruff.pydocstyle]
convention = "google"

[tool.ruff.pyupgrade]
keep-runtime-typing = true

[tool.mypy]
python_version = "3.8"
pretty = true
show_traceback = true
color_output = true
check_untyped_defs = true
disallow_incomplete_defs = true
ignore_missing_imports = true
implicit_reexport = true
strict_equality = true
strict_optional = false
warn_no_return = true
warn_redundant_casts = true
warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = true
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ six==1.16.0
sniffio==1.3.0
tomli==2.0.1
twine==4.0.2
typing_extensions==4.6.3
typing-extensions==4.6.3
urllib3==2.0.4
webencodings==0.5.1
websockets==10.4
Expand Down