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

Apply updates from cookiecutter #36

Merged
merged 1 commit into from
Oct 3, 2023
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
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ jobs:
python-version: ${{ matrix.python-version }}
- run: python -m pip install 'tox<4'
- run: tox -e tests
env:
COVERAGE_FILE: .coverage.${{ matrix.python-version }}
- name: Upload coverage file
uses: actions/upload-artifact@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ jobs = 0 # Use one process for CPU.
load-plugins = [
"pylint.extensions.bad_builtin",
"pylint.extensions.check_elif",
"pylint.extensions.comparetozero",
"pylint.extensions.docparams",
"pylint.extensions.emptystring",
"pylint.extensions.mccabe",
"pylint.extensions.overlapping_exceptions",
"pylint.extensions.redefined_variable_type",
Expand All @@ -95,6 +93,8 @@ enable = [
"deprecated-pragma",
"useless-suppression",
"use-symbolic-message-instead",
"use-implicit-booleaness-not-comparison-to-zero",
"use-implicit-booleaness-not-comparison-to-string",
]
disable = [
# Docstrings are encouraged but we don't want to enforce that everything
Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package_dir =
packages = find:
python_requires = >=3.8
install_requires =
importlib_metadata;python_version<"3.8."
jsonschema>=4.18
importlib_resources
referencing
Expand Down
3 changes: 0 additions & 3 deletions src/h_api/bulk_api/model/data_body.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,6 @@ class _IdRef: # pylint: disable=too-few-public-methods
"""A value object which represents an id reference or concrete id."""

def __init__(self, value):
# pylint: disable=invalid-name
# We're using "id"... fight me

if isinstance(value, dict):
self.id, self.ref = None, value.get("$ref")
else:
Expand Down
2 changes: 1 addition & 1 deletion src/h_api/bulk_api/model/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def __init__(self, id_, public_id=None):
if id_ is None:
raise ValueError("id_ is required for successful outcomes")

self.id = id_ # pylint: disable=invalid-name
self.id = id_
self.public_id = id_ if public_id is None else public_id

def __repr__(self):
Expand Down
2 changes: 1 addition & 1 deletion src/h_api/model/json_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def create(
)

@property
def id(self): # pylint: disable=invalid-name
def id(self):
"""Get the id."""

return self._data["id"]
Expand Down
4 changes: 2 additions & 2 deletions tests/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ jobs = 0 # Use one process for CPU.
load-plugins = [
"pylint.extensions.bad_builtin",
"pylint.extensions.check_elif",
"pylint.extensions.comparetozero",
"pylint.extensions.docparams",
"pylint.extensions.emptystring",
"pylint.extensions.mccabe",
"pylint.extensions.overlapping_exceptions",
"pylint.extensions.redefined_variable_type",
Expand All @@ -25,6 +23,8 @@ enable = [
"deprecated-pragma",
"useless-suppression",
"use-symbolic-message-instead",
"use-implicit-booleaness-not-comparison-to-zero",
"use-implicit-booleaness-not-comparison-to-string",
]
disable = [
# Docstrings are encouraged but we don't want to enforce that everything
Expand Down
10 changes: 6 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ setenv =
dev: NEW_RELIC_ENVIRONMENT = {env:NEW_RELIC_ENVIRONMENT:dev}
dev,tests,functests: PYTHONDEVMODE = {env:PYTHONDEVMODE:1}
tests,functests: PYTEST_PLUGINS = tests.pytest_plugins.factory_boy
tests: COVERAGE_FILE = {env:COVERAGE_FILE:.coverage.{envname}}
passenv =
HOME
PYTEST_ADDOPTS
Expand All @@ -31,12 +32,13 @@ deps =
format,checkformatting: black
format,checkformatting: isort
lint: toml
lint: pylint
lint: pylint>=3.0.0
lint: pydocstyle
lint: pycodestyle
lint,tests: pytest-mock
lint,tests,coverage: coverage[toml]
lint,tests,functests: pytest
tests: pytest-coverage
coverage: coverage[toml]
lint,tests,functests: factory-boy
lint,tests,functests: pytest-factoryboy
lint,tests,functests: h-matchers
Expand All @@ -53,8 +55,8 @@ commands =
lint: pylint --rcfile=tests/pyproject.toml tests
lint: pydocstyle src tests bin
lint: pycodestyle src tests bin
tests: coverage run -m pytest --failed-first --new-first --no-header --quiet {posargs:tests/unit/}
tests: python -m pytest --cov --cov-report= --cov-fail-under=0 --failed-first --new-first --no-header --quiet {posargs:tests/unit/}
functests: python -m pytest --failed-first --new-first --no-header --quiet {posargs:tests/functional/}
coverage: -coverage combine
coverage: coverage combine
coverage: coverage report
template: python3 bin/make_template {posargs}