Skip to content

Commit

Permalink
Some small CI improvements (#628)
Browse files Browse the repository at this point in the history
  • Loading branch information
FasterSpeeding authored Dec 8, 2022
1 parent 5ec16f7 commit 5224358
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/reformat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ jobs:
python -m pip install --upgrade pip wheel
python -m pip install -r ./dev-requirements/nox.txt
- name: Reformat code
- name: Reformat
run: python -m nox -s reformat

- name: Add & Commit
uses: EndBug/[email protected]
with:
message: "Reformat code"
message: "Reformat"
4 changes: 1 addition & 3 deletions examples/injection.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ async def _fetch_info(database: protos.DatabaseProto = tanjun.inject(type=protos


# Since this is being used as an injected callback, we can also ask for an injected type here.
async def _fetch_cachable_info(
database: protos.DatabaseProto = tanjun.inject(type=protos.DatabaseProto),
) -> typing.Any:
async def _fetch_cachable_info(database: protos.DatabaseProto = tanjun.inject(type=protos.DatabaseProto)) -> typing.Any:
raise NotImplementedError # This is an example callback and doesn't provide an implementation.


Expand Down
9 changes: 2 additions & 7 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,7 @@
"test",
"verify-types",
]
GENERAL_TARGETS = ["./noxfile.py", "./tests"]
TOP_LEVEL_TARGETS = ["./tanjun", "./tests", "./noxfile.py"]
_BLACKLISTED_TARGETS = re.compile("^_internal/vendor/.*\\.py")
for path in pathlib.Path("./tanjun").glob("**/*.py"):
if not _BLACKLISTED_TARGETS.match(str(path.relative_to("./tanjun")).replace("\\", "/")):
GENERAL_TARGETS.append(str(path))
TOP_LEVEL_TARGETS = ["./examples", "./noxfile.py", "./tanjun", "./tests"]


_DEV_DEP_DIR = pathlib.Path("./dev-requirements")
Expand Down Expand Up @@ -190,7 +185,7 @@ def flake8(session: nox.Session) -> None:
"""Run this project's modules against the pre-defined flake8 linters."""
install_requirements(session, *_dev_dep("flake8"))
session.log("Running flake8")
session.run("pflake8", *GENERAL_TARGETS, log=False)
session.run("pflake8", *TOP_LEVEL_TARGETS, log=False)


@nox.session(reuse_venv=True, name="slot-check")
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ ignore = [
"E231", # missing whitespace after ','
]
per-file-ignores = [
"examples/*.py: D101, D103, E800, FA100, FA101",
"noxfile.py: D100, D101, D103, INP001",
"tanjun/py.typed: D100",
"tests/*.py: CCE002, D100, D101, D103, D104, FA100, FA101"
Expand Down

0 comments on commit 5224358

Please sign in to comment.