Skip to content

Commit

Permalink
fix: pylint should run on compiled code
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <[email protected]>
  • Loading branch information
henryiii committed Jul 27, 2023
1 parent 43a7fb4 commit 83a7fe5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/pages/guides/style.md
Original file line number Diff line number Diff line change
Expand Up @@ -765,9 +765,9 @@ And a noxfile entry:
```python
@nox.session
def pylint(session: nox.Session) -> None:
session.install("-e", ".")
session.install("-e.")
session.install("pylint")
session.run("pylint", "src", *session.posargs)
session.run("pylint", "<your package>", *session.posargs)
```

And you can add this to your GitHub Actions using `run: pipx run nox -s pylint`.
Expand Down
2 changes: 1 addition & 1 deletion {{cookiecutter.project_name}}/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def pylint(session: nox.Session) -> None:
# This needs to be installed into the package environment, and is slower
# than a pre-commit check
session.install(".", "pylint")
session.run("pylint", "src", *session.posargs)
session.run("pylint", "{{ cookiecutter.__project_slug }}", *session.posargs)


@nox.session
Expand Down
5 changes: 4 additions & 1 deletion {{cookiecutter.project_name}}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,10 @@ isort.required-imports = ["from __future__ import annotations"]

[tool.pylint]
py-version = "3.8"
ignore-paths= ["src/{{ cookiecutter.__project_slug }}/_version.py"]
ignore-paths = [".*/_version.py"]
{%- if cookiecutter.__type == "compiled" %}
extension-pkg-allow-list = ["{{ cookiecutter.__project_slug }}._core"]
{%- endif %}
reports.output-format = "colorized"
similarities.ignore-imports = "yes"
messages_control.disable = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ tests:
matrix:
- IMAGE: ['python:3.8-buster', 'python:3.11-buster']

{%- if not cookiecutter.__compiled %}
{%- if cookiecutter.__type == "pure" %}
package:
stage: build
rules:
Expand Down Expand Up @@ -141,7 +141,7 @@ make_wheels:
.deploy:
stage: deploy
dependencies:
{%- if not cookiecutter.__compiled %}
{%- if cookiecutter.__type == "pure" %}
- package
{%- else %}
- make_sdist
Expand Down

0 comments on commit 83a7fe5

Please sign in to comment.