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

cruft: update template #228

Merged
merged 1 commit into from
Nov 22, 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: 1 addition & 1 deletion .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "https://github.com/iterative/py-template",
"commit": "c51909e5f801875301f230fae3cade297fad2a85",
"commit": "15ee26df315020399731c6291d61bef81a3fc5d3",
"checkout": null,
"context": {
"cookiecutter": {
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:

steps:
- name: Check out the repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -51,7 +51,7 @@ jobs:
run: nox -s tests-${{ matrix.nox_pyv || matrix.pyv }} -- --cov-report=xml

- name: Upload coverage report
uses: codecov/codecov-action@v3.1.1
uses: codecov/codecov-action@v3.1.4

- name: Build package
run: nox -s build
2 changes: 1 addition & 1 deletion .github/workflows/update-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Update template
uses: iterative/py-template@main
29 changes: 6 additions & 23 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
default_language_version:
python: python3
repos:
- repo: https://github.com/psf/black
rev: 23.7.0
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
Expand All @@ -23,6 +19,12 @@ repos:
args: ['--fix=lf']
- id: sort-simple-yaml
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.1.5'
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
- repo: https://github.com/codespell-project/codespell
rev: v2.2.5
hooks:
Expand All @@ -33,22 +35,3 @@ repos:
hooks:
- id: pyupgrade
args: [--py38-plus]
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/pycqa/flake8
rev: 6.1.0
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear==23.1.20
- flake8-comprehensions==3.10.1
- flake8-debugger==4.1.2
- flake8-string-format==0.3.0
- repo: https://github.com/pycqa/bandit
rev: 1.7.5
hooks:
- id: bandit
args: [-c, pyproject.toml]
additional_dependencies: [".[toml]"]
1 change: 0 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ def lint(session: nox.Session) -> None:
args = *(session.posargs or ("--show-diff-on-failure",)), "--all-files"
session.run("pre-commit", "run", *args)
session.run("python", "-m", "mypy")
session.run("python", "-m", "pylint", "src")


@nox.session
Expand Down
92 changes: 48 additions & 44 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,55 @@ build-backend = "setuptools.build_meta"

[tool.setuptools_scm]

[tool.black]
line-length = 88
include = '\.pyi?$'
exclude = '''
/(
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
)/
'''
[project]
name = "dvc-objects"
description = "dvc objects"
readme = "README.rst"
license = {text = "Apache-2.0"}
authors = [{ name = "Iterative", email = "support@dvc.org" }]
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Development Status :: 4 - Beta",
]
requires-python = ">=3.8"
dynamic = ["version"]
dependencies = [
"tqdm>=4.63.1,<5",
"shortuuid>=0.5.0",
"funcy>=1.14",
"fsspec>=2022.10.0",
"typing-extensions>=3.7.4",
"packaging>=19",
]

[project.urls]
Issues = "https://github.com/iterative/dvc-objects/issues"
Source = "https://github.com/iterative/dvc-objects"

[project.optional-dependencies]
tests = [
"pytest==7.2.0",
"pytest-sugar==0.9.6",
"pytest-cov==4.0.0",
"pytest-mock==3.8.2",
"mypy==1.5.1",
"pytest-servers[s3]==0.1.3",
]
dev = [
"dvc-objects[tests]",
"types-tqdm",
]

[tool.isort]
profile = "black"
known_first_party = ["dvc_objects"]
line_length = 88
[tool.setuptools.packages.find]
where = ["src"]
namespaces = false

[tool.setuptools.package-data]
dvc_objects = ["py.typed"]

[tool.pytest.ini_options]
addopts = "-ra -Werror"
Expand Down Expand Up @@ -73,28 +100,5 @@ module = [
"funcy",
]

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

[tool.pylint.message_control]
enable = ["no-else-return"]
disable = [
"format", "refactoring", "spelling", "design",
"invalid-name", "duplicate-code", "fixme",
"unused-wildcard-import", "cyclic-import", "wrong-import-order",
"wrong-import-position", "ungrouped-imports", "multiple-imports",
"logging-format-interpolation", "logging-fstring-interpolation",
"missing-function-docstring", "missing-module-docstring",
"missing-class-docstring", "raise-missing-from", "import-outside-toplevel",
]

[tool.pylint.variables]
dummy-variables-rgx = "_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_"
ignored-argument-names = "_.*|^ignored_|^unused_|args|kwargs"

[tool.codespell]
ignore-words-list = " "

[tool.bandit]
exclude_dirs = ["tests"]
skips = ["B101"]
71 changes: 0 additions & 71 deletions setup.cfg

This file was deleted.

3 changes: 2 additions & 1 deletion src/dvc_objects/fs/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ def _get_kwargs_from_urls(urlpath: str) -> "Dict[str, Any]":
return options

def _prepare_credentials(
self, **config: Dict[str, Any] # pylint: disable=unused-argument
self,
**config: Dict[str, Any], # pylint: disable=unused-argument
) -> Dict[str, Any]:
"""Prepare the arguments for authentication to the
host filesystem"""
Expand Down
5 changes: 3 additions & 2 deletions src/dvc_objects/fs/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ def _cdll(name):
clib = _cdll(LIBC)
except OSError as exc:
logger.debug(
"unable to access '{}' (errno '{}'). "
"Falling back to '{}'.".format(LIBC, exc.errno, LIBC_FALLBACK)
"unable to access '{}' (errno '{}'). " "Falling back to '{}'.".format(
LIBC, exc.errno, LIBC_FALLBACK
)
)
if exc.errno != errno.ENOENT:
raise
Expand Down