-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
π§βπ» devxp: add editorconfig and copier answers (#25)
* π§ config(pre-commit): update * π§βπ» devxp: add editorconfig and copier answers * π§ config: update pyproject and sync * π§ config(ruff): add back old ignores * π§ config(mypy): add mypy paths * β test(utils): make sure client is always closed
- Loading branch information
Showing
6 changed files
with
279 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Changes here will be overwritten by Copier | ||
_commit: v0.0.3 | ||
_src_path: [email protected]:ljnsn/copier-python-poly.git | ||
author_email: [email protected] | ||
author_name: ljnsn | ||
ci: true | ||
ci_provider: github | ||
commitizen: true | ||
coverage: true | ||
cz_gitmoji: true | ||
description: CoinAPI Python REST Client | ||
license: MIT | ||
loguru: false | ||
maximum_python_version: '' | ||
minimum_python_version: '3.10' | ||
mypy: true | ||
package_manager: uv | ||
pre_commit: true | ||
project_name: coinapi-rest | ||
project_snake: coinapi | ||
pytest: true | ||
ruff: true | ||
sqlalchemy: false | ||
structure: src | ||
web_app: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
root = true | ||
|
||
[*] | ||
tab_width = 4 | ||
end_of_line = lf | ||
max_line_length = 88 | ||
ij_visual_guides = 88,120 | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.{js,py,html}] | ||
charset = utf-8 | ||
|
||
[*.{js,jsx,ts,tsx}] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[*.{json,yml,yaml}] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[Makefile] | ||
indent_style = tab | ||
|
||
[.flake8] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.py] | ||
indent_style = space | ||
indent_size = 4 | ||
ij_python_from_import_parentheses_force_if_multiline = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,15 +13,8 @@ name = "coinapi-rest" | |
version = "0.0.5" | ||
description = "CoinAPI Python REST Client" | ||
authors = [{ name = "ljnsn", email = "[email protected]" }] | ||
dependencies = [ | ||
"httpx>=0.27.0", | ||
"msgspec>=0.18.6", | ||
"python-dotenv>=1.0.1", | ||
"typing-inspect>=0.9.0", | ||
] | ||
requires-python = ">=3.10" | ||
readme = "README.md" | ||
license = { text = "MIT" } | ||
license = "MIT" | ||
urls = { repository = "https://github.com/ljnsn/coinapi-rest" } | ||
keywords = ["cryptocurrency", "crypto", "prices", "coinapi"] | ||
classifiers = [ | ||
|
@@ -38,18 +31,27 @@ classifiers = [ | |
"Topic :: Software Development :: Libraries :: Python Modules", | ||
"Typing :: Typed", | ||
] | ||
requires-python = ">=3.10" | ||
dependencies = [ | ||
"httpx>=0.27.0", | ||
"msgspec>=0.18.6", | ||
"python-dotenv>=1.0.1", | ||
"typing-inspect>=0.9.0", | ||
] | ||
|
||
[tool.uv] | ||
dev-dependencies = [ | ||
"commitizen>=3.16.0", | ||
"coverage>=7.4.3", | ||
"cz-conventional-gitmoji>=0.2.4", | ||
"ipython!=8.18.0", | ||
"mypy>=1.8.0", | ||
"pre-commit>=3.6.2", | ||
"commitizen>=3.29.0", | ||
"coverage>=7.6.1", | ||
"cz-conventional-gitmoji>=0.3.3", | ||
"ipdb>=0.13.13", | ||
"ipython>=7.16.1,!=8.18.0", | ||
"mypy>=0.1.8", | ||
"pre-commit>=1.4.3", | ||
"pytest-cov>=5.0.0", | ||
"pytest-recording>=0.13.1", | ||
"pytest>=8.0.0", | ||
"ruff>=0.3.0", | ||
"pytest>=8.3.2", | ||
"ruff>=0.2.2", | ||
"syrupy>=0.0.15", | ||
] | ||
|
||
|
@@ -59,49 +61,19 @@ version_provider = "pep621" | |
tag_format = "v$version" | ||
bump_message = "π bump(release): v$current_version β v$new_version" | ||
update_changelog_on_bump = true | ||
|
||
[tool.mypy] | ||
mypy_path = ["src", "tests"] | ||
namespace_packages = true | ||
explicit_package_bases = true | ||
junit_xml = "reports/mypy.xml" | ||
strict = true | ||
disallow_subclassing_any = false | ||
disallow_untyped_decorators = false | ||
ignore_missing_imports = true | ||
pretty = false | ||
show_column_numbers = true | ||
show_error_codes = true | ||
show_error_context = true | ||
warn_unreachable = true | ||
|
||
[tool.coverage.run] | ||
branch = true | ||
command_line = "--module pytest" | ||
data_file = "reports/.coverage" | ||
include = ["src/*"] | ||
omit = ["tests/*"] | ||
|
||
[tool.coverage.paths] | ||
source = ["src/"] | ||
|
||
[tool.coverage.report] | ||
fail_under = 50 | ||
precision = 1 | ||
show_missing = true | ||
skip_covered = true | ||
include = ["src/*"] | ||
omit = ["tests/*"] | ||
|
||
[tool.coverage.xml] | ||
output = "reports/coverage.xml" | ||
|
||
annotated_tag = true | ||
allowed_prefixes = ["Squash", "Merge", "Revert"] | ||
pre_bump_hooks = ["uv lock --upgrade-package coinapi-rest"] | ||
[tool.ruff] | ||
fix = true | ||
target-version = "py310" | ||
src = ["src", "test"] | ||
src = ["src", "tests"] | ||
line-length = 88 | ||
|
||
[tool.ruff.format] | ||
line-ending = "lf" | ||
indent-style = "space" | ||
|
||
[tool.ruff.lint] | ||
logger-objects = ["loguru"] | ||
select = ["ALL"] | ||
|
@@ -140,6 +112,12 @@ ignore = [ | |
"TD001", | ||
# Line contains FIXME, consider resolving the issue | ||
"FIX001", | ||
# from * used; unable to detect undefined names | ||
"F403", | ||
# may be undefined, or defined from star imports | ||
"F405", | ||
# Docstring contains ambiguous `β` | ||
"RUF002", | ||
############################################################################# | ||
# Rules conflicting with `ruff format` | ||
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules | ||
|
@@ -174,12 +152,6 @@ ignore = [ | |
"ISC001", | ||
# Multiline implicit string concatenation | ||
"ISC002", | ||
# from * used; unable to detect undefined names | ||
"F403", | ||
# may be undefined, or defined from star imports | ||
"F405", | ||
# Docstring contains ambiguous `β` | ||
"RUF002", | ||
] | ||
unfixable = ["ERA001", "F401", "F841"] | ||
|
||
|
@@ -189,20 +161,22 @@ unfixable = ["ERA001", "F401", "F841"] | |
"DTZ001", | ||
# positional boolean args | ||
"FBT001", | ||
# part of an implicit namespace package | ||
"INP001", | ||
# usage of `assert` in tests | ||
"S101", | ||
# magic value used in comarison | ||
"PLR2004", | ||
# private member accessed | ||
"SLF001", | ||
] | ||
|
||
[tool.ruff.format] | ||
line-ending = "lf" | ||
indent-style = "space" | ||
"scripts/**/*.py" = [ | ||
# part of implicit namespace package | ||
"INP001", | ||
] | ||
|
||
[tool.ruff.lint.isort] | ||
known-first-party = ["coinapi"] | ||
known-first-party = ["coinapi", "tests"] | ||
|
||
[tool.ruff.lint.pydocstyle] | ||
convention = "google" | ||
|
@@ -214,10 +188,46 @@ ban-relative-imports = "all" | |
[tool.ruff.lint.pep8-naming] | ||
classmethod-decorators = ["classmethod"] | ||
|
||
[tool.mypy] | ||
mypy_path = ["src", "tests"] | ||
namespace_packages = true | ||
explicit_package_bases = true | ||
junit_xml = "reports/mypy.xml" | ||
strict = true | ||
disallow_subclassing_any = false | ||
disallow_untyped_decorators = false | ||
ignore_missing_imports = true | ||
pretty = false | ||
show_column_numbers = true | ||
show_error_codes = true | ||
show_error_context = true | ||
warn_unreachable = true | ||
|
||
[tool.pytest.ini_options] | ||
addopts = """--color=yes --doctest-modules --exitfirst --failed-first \ | ||
--strict-markers --strict-config --verbosity=2 \ | ||
--junitxml=reports/pytest.xml""" | ||
filterwarnings = ["ignore::DeprecationWarning", "ignore::ResourceWarning"] | ||
testpaths = ["src", "tests"] | ||
filterwarnings = ["error"] | ||
testpaths = ["tests"] | ||
markers = ["network: mark a test as needing a network connection"] | ||
|
||
[tool.coverage.run] | ||
branch = true | ||
command_line = "--module pytest" | ||
data_file = "reports/.coverage" | ||
include = ["src/*"] | ||
omit = ["tests/*"] | ||
|
||
[tool.coverage.report] | ||
fail_under = 50 | ||
precision = 1 | ||
show_missing = true | ||
skip_covered = true | ||
include = ["src/*"] | ||
omit = ["tests/*"] | ||
|
||
[tool.coverage.paths] | ||
source = ["src/"] | ||
|
||
[tool.coverage.xml] | ||
output = "reports/coverage.xml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.