-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* PWSH -> nox Signed-off-by: GitHub <[email protected]> * Update lints Signed-off-by: GitHub <[email protected]> * Add Pydantic Signed-off-by: GitHub <[email protected]> * Raw conversion of dataclasses to models Signed-off-by: GitHub <[email protected]> * Get tests passing Signed-off-by: GitHub <[email protected]> * Remove extraneous dash Signed-off-by: GitHub <[email protected]> * Remove another extraneous dash Signed-off-by: GitHub <[email protected]> * Add tests for new Python verisons Signed-off-by: GitHub <[email protected]> --------- Signed-off-by: GitHub <[email protected]>
- Loading branch information
1 parent
70ee6c1
commit 7103c8f
Showing
16 changed files
with
124 additions
and
398 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
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
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
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
"""Noxfile.""" | ||
|
||
import shutil | ||
from pathlib import Path | ||
|
||
import nox | ||
|
||
nox.options.default_venv_backend = "none" | ||
nox.options.sessions = ["lints"] | ||
|
||
|
||
CLEANABLE_TARGETS = [ | ||
"./dist", | ||
"./build", | ||
"./.nox", | ||
"./.coverage", | ||
"./.coverage.*", | ||
"./coverage.json", | ||
"./**/.mypy_cache", | ||
"./**/.pytest_cache", | ||
"./**/__pycache__", | ||
"./**/*.pyc", | ||
"./**/*.pyo", | ||
] | ||
|
||
|
||
@nox.session | ||
def tests(session: nox.Session) -> None: | ||
"""Run tests.""" | ||
session.run("pytest") | ||
|
||
|
||
@nox.session | ||
def lints(session: nox.Session) -> None: | ||
"""Run lints.""" | ||
session.run("pre-commit", "run", "--all-files") | ||
session.run("ruff", "format", ".") | ||
session.run("ruff", "check", "--fix", ".") | ||
session.run("mypy", "--strict", "src/") | ||
|
||
|
||
@nox.session | ||
def clean(_: nox.Session) -> None: | ||
"""Clean cache, .pyc, .pyo, and test/build artifact files from project.""" | ||
count = 0 | ||
for searchpath in CLEANABLE_TARGETS: | ||
for filepath in Path().glob(searchpath): | ||
if filepath.is_dir(): | ||
shutil.rmtree(filepath) | ||
else: | ||
filepath.unlink() | ||
count += 1 |
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 |
---|---|---|
|
@@ -2,15 +2,14 @@ | |
name = "letsbuilda-pypi" | ||
version = "5.2.1" | ||
description = "A wrapper for PyPI's API and RSS feed" | ||
authors = [ | ||
{ name = "Bradley Reynolds", email = "[email protected]" }, | ||
] | ||
authors = [{ name = "Bradley Reynolds", email = "[email protected]" }] | ||
license = { text = "MIT" } | ||
readme = "README.md" | ||
requires-python = ">=3.11" | ||
dependencies = [ | ||
"httpx", | ||
"xmltodict", | ||
"pydantic", | ||
] | ||
|
||
[project.urls] | ||
|
@@ -20,6 +19,7 @@ documentation = "https://docs.letsbuilda.dev/letsbuilda-pypi/" | |
[project.optional-dependencies] | ||
dev = [ | ||
"pre-commit", | ||
"nox", | ||
"ruff", | ||
"mypy", | ||
"types-xmltodict", | ||
|
@@ -42,26 +42,24 @@ build-backend = "setuptools.build_meta" | |
"letsbuilda.pypi" = ["py.typed"] | ||
|
||
[tool.ruff] | ||
preview = true | ||
unsafe-fixes = true | ||
target-version = "py311" | ||
target-version = "py312" | ||
line-length = 120 | ||
|
||
[tool.ruff.lint] | ||
select = ["ALL"] | ||
ignore = [ | ||
"CPY001", # (Missing copyright notice at top of file) | ||
"CPY001", # (Missing copyright notice at top of file) | ||
"PLC0414", # (Import alias does not rename original package) - Re-exporting | ||
] | ||
|
||
[tool.ruff.lint.extend-per-file-ignores] | ||
"docs/*" = [ | ||
"INP001", # (File `tests/*.py` is part of an implicit namespace package. Add an `__init__.py`.) - Docs are not modules | ||
"FA102", # (Missing `from __future__ import annotations`, but uses PEP 585 collection) - Docs are actually built on the latest stable release of Python | ||
"FA102", # (Missing `from __future__ import annotations`, but uses PEP 585 collection) - Docs are actually built on the latest stable release of Python | ||
] | ||
"tests/*" = [ | ||
"INP001", # (File `tests/*.py` is part of an implicit namespace package. Add an `__init__.py`.) - Tests are not modules | ||
"S101", # (Use of `assert` detected) - Yes, that's the point | ||
"S101", # (Use of `assert` detected) - Yes, that's the point | ||
] | ||
|
||
[tool.ruff.lint.isort] | ||
|
@@ -70,7 +68,11 @@ known-first-party = ["letsbuilda.pypi"] | |
[tool.ruff.lint.pydocstyle] | ||
convention = "numpy" | ||
|
||
[tool.mypy] | ||
plugins = ["pydantic.mypy"] | ||
|
||
[tool.coverage.run] | ||
source = [ | ||
"letsbuilda.pypi", | ||
] | ||
source = ["letsbuilda.pypi"] | ||
|
||
[tool.pytest.ini_options] | ||
addopts = "--strict-markers" |
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.