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

Gut deps further #5

Merged
merged 3 commits into from
Jan 3, 2025
Merged
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
19 changes: 0 additions & 19 deletions .github/workflows/check-code-style.yml

This file was deleted.

10 changes: 1 addition & 9 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,11 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: '0.5.5'
enable-cache: true
cache-dependency-glob: "uv.lock"

- uses: actions/setup-python@v5
with:
python-version-file: 'pyproject.toml'

- name: Run pre-commit
run: uv run pre-commit run --all-files
- uses: pre-commit/[email protected]

- name: Fail on diff after pre-commit is run
run: git diff --exit-code
11 changes: 2 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,14 @@ repos:
args: ["--branch", "master"]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.9
rev: v0.8.4
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format

- repo: https://github.com/PyCQA/bandit
rev: 1.7.6
hooks:
- id: bandit
args: ["-c", "pyproject.toml"]
additional_dependencies: ["bandit[toml]"]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
rev: v1.14.1
hooks:
- id: mypy
additional_dependencies:
Expand Down
2 changes: 1 addition & 1 deletion easyeda2kicad/easyeda/easyeda_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def extract_easyeda_data(self, ee_data: dict, ee_data_info: dict) -> EeSymbol:
),
)

if "subparts" in ee_data and ee_data["subparts"]:
if ee_data.get("subparts"):
for unit in ee_data["subparts"]:
new_ee_unit = EeSymbolUnit(
bbox=EeSymbolBbox(
Expand Down
3 changes: 1 addition & 2 deletions easyeda2kicad/easyeda/parameters_easyeda.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,7 @@ def parse_background_filling(cls, fill_color: str) -> str:


# ---------------- POLYGON ----------------
class EeSymbolPolygon(EeSymbolPolyline):
...
class EeSymbolPolygon(EeSymbolPolyline): ...


# ---------------- PATH ----------------
Expand Down
3 changes: 1 addition & 2 deletions easyeda2kicad/easyeda/svg_path_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ class SvgPathEllipticalArc(BaseModel):
end_y: float


class SvgPathClosePath(BaseModel):
...
class SvgPathClosePath(BaseModel): ...


svg_path_handlers = {
Expand Down
88 changes: 10 additions & 78 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ dependencies = [
[project.optional-dependencies]
dev = [
"pre-commit>=3.6.0",
"ruff>=0.1.9",
"mypy>=1.8.0",
"bandit[toml]>=1.7.6",
"ruff>=0.8.4",
"mypy>=1.14.1",
]

[project.urls]
Expand All @@ -52,22 +51,6 @@ source = "vcs"
[tool.hatch.build.hooks.vcs]
version-file = "easyeda2kicad/_version.py"

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

[tool.isort]
profile = "black"
extend_skip = [".md", ".json", ".po", ".mo",".html", ".js", ".css", ".rst"]
skip_glob = ["env/*"]
known_local_folder = ["core"]
import_heading_stdlib="Global imports"
import_heading_localfolder="Local imports"

[tool.pycln]
include=".*\\.py$"
exclude="(.eggs|.git|.hg|.mypy_cache|__pycache__|.nox|.tox|.venv|.svn|buck-out|build|dist|env|)/"

# https://mypy.readthedocs.io/en/stable/config_file.html
[tool.mypy]
python_version = "3.12"
Expand All @@ -82,70 +65,11 @@ warn_return_any = false
disallow_incomplete_defs = false
no_implicit_optional = false

[tool.pylint.master]
output-format = "colorized"
extension-pkg-whitelist = [
"pydantic"
]
ignore="(.eggs|.git|.hg|.mypy_cache|__pycache__|.nox|.tox|.venv|.svn|buck-out|build|dist|env|)/"

[tool.pylint.format]
max-line-length = 88

[tool.pylint.messages_control]
disable = [
"wrong-import-order",
"method-hidden",
"too-many-lines",
"wildcard-import",
"missing-module-docstring",
"missing-class-docstring",
"missing-function-docstring",
"logging-fstring-interpolation",
]

[tool.bandit]
exclude_dirs = ["tests", "examples"]
skips = ["B101", "B113"]

[tool.hatch.envs.lint]
dependencies = [
"black>=23.0.0",
"isort>=5.12.0",
"flake8>=6.1.0",
"flake8-bugbear",
"flake8-comprehensions",
"bandit[toml]>=1.7.5",
"mypy>=1.7.0",
]

[tool.hatch.envs.lint.scripts]
style = [
"black .",
"isort .",
"flake8 .",
]
typing = "mypy --install-types --non-interactive ."
security = "bandit -r ."
all = [
"style",
"typing",
"security",
]

[tool.ruff]
line-length = 88
target-version = "py312"
fix = true
unsafe-fixes = false
extend-select = [
"B",
"C4",
"I",
"RUF",
"W",
"YTT",
]

[tool.ruff.lint]
select = [
Expand All @@ -155,6 +79,14 @@ select = [
"B",
"C4",
]
extend-select = [
"B",
"C4",
"I",
"RUF",
"W",
"YTT",
]
ignore = [
"B034",
"E501",
Expand Down
96 changes: 3 additions & 93 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading