Skip to content

Commit

Permalink
General project cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
eseglem committed Feb 5, 2024
1 parent dcd42bf commit d3a76d9
Show file tree
Hide file tree
Showing 6 changed files with 183 additions and 13 deletions.
121 changes: 119 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,59 @@
# Created by https://www.toptal.com/developers/gitignore/api/linux,macos,direnv,python,windows,visualstudiocode
# Edit at https://www.toptal.com/developers/gitignore?templates=linux,macos,direnv,python,windows,visualstudiocode

### direnv ###
.direnv
.envrc

### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### macOS Patch ###
# iCloud generated files
*.icloud

### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down Expand Up @@ -152,5 +208,66 @@ dmypy.json
# Cython debug symbols
cython_debug/

# VSCode
.vscode/
# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

### Python Patch ###
# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
poetry.toml

# ruff
.ruff_cache/

# LSP config files
pyrightconfig.json

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

# Local History for Visual Studio Code
.history/

# Built Visual Studio Code Extensions
*.vsix

### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide

### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

# End of https://www.toptal.com/developers/gitignore/api/linux,macos,direnv,python,windows,visualstudiocode
6 changes: 1 addition & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ repos:
hooks:
- id: ruff
args: ["--fix"]
- repo: https://github.com/psf/black
rev: 24.1.1
hooks:
- id: black
language_version: python
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
Expand Down
12 changes: 12 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"recommendations": [
"charliermarsh.ruff",
"DavidAnson.vscode-markdownlint",
"EditorConfig.EditorConfig",
"esbenp.prettier-vscode",
"ms-python.debugpy",
"ms-python.python",
"ms-python.vscode-pylance",
"tamasfe.even-better-toml"
]
}
22 changes: 22 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[python]": {
"editor.codeActionsOnSave": {
"source.fixAll": "always",
"source.organizeImports": "always"
},
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnSave": true,
"editor.inlineSuggest.enabled": true
},
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"markdownlint.config": {
"default": true,
"MD007": {
"indent": 4
}
}
}
1 change: 0 additions & 1 deletion pycql2/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
__version__ = "0.1.0"
34 changes: 29 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Poetry
[tool.poetry]
name = "pycql2"
version = "0.2.0"
Expand Down Expand Up @@ -48,9 +49,11 @@ fuzz = ["hypofuzz"]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"


# Ruff
[tool.ruff]
target-version = "py38"

[tool.ruff.lint]
select = [
"F", # pyflakes
"E", # pycodestyle errors
Expand All @@ -68,29 +71,45 @@ select = [
"TRY", # tryceratops
"RUF", # Ruff specific rules
]
fix = true
ignore = [
"E501", # Black handles line length
"E501", # Line length is handled automatically
]

[tool.ruff.isort]
[tool.ruff.lint.isort]
combine-as-imports = true

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"test_*" = [
"S101", # Use of assert is fine in tests
]

# Pytest
[tool.pytest.ini_options]
pythonpath = "pycql2"
testpaths = ["tests"]
# Most of the tests compare highly nested pydantic models and are truncated
# without extra verbosity.
addopts = "-vv"

# Coverage
[tool.coverage.run]
source = ["pycql2"]
branch = true

[tool.coverage.report]
show_missing = true
skip_empty = true

# MyPy
[tool.mypy]
mypy_path = "pycql2"
python_version = "3.10"
plugins = ["pydantic.mypy"]
show_error_codes = true
check_untyped_defs = true
namespace_packages = true
no_implicit_reexport = true
no_implicit_optional = true
disallow_incomplete_defs = true
disallow_untyped_calls = true
disallow_untyped_defs = true
Expand All @@ -101,3 +120,8 @@ warn_redundant_casts = true
[[tool.mypy.overrides]]
module = ["rich"]
ignore_missing_imports = true

[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
warn_required_dynamic_aliases = true

0 comments on commit d3a76d9

Please sign in to comment.