Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • jelmer/swh-loader-bzr
  • anlambert/swh-loader-bzr
  • lunar/swh-loader-bzr
  • ardumont/swh-loader-bzr
  • swh/devel/swh-loader-bzr
  • douardda/swh-loader-bzr
  • marmoute/swh-loader-bzr
  • olasd/swh-loader-bzr
8 results
Show changes
Commits on Source (12)
# Changes here will be overwritten by Copier
_commit: v0.2.0
_commit: v0.3.3
_src_path: https://gitlab.softwareheritage.org/swh/devel/swh-py-template.git
description: Software Heritage Bazaar/Breezy loader
distribution_name: swh-loader-bzr
......
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: check-json
- id: check-yaml
- repo: https://github.com/python/black
rev: 23.1.0
rev: 25.1.0
hooks:
- id: black
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 6.0.0
hooks:
- id: isort
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
rev: 7.1.1
hooks:
- id: flake8
additional_dependencies: [flake8-bugbear==22.9.23]
additional_dependencies: [flake8-bugbear==24.12.12, flake8-pyproject]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.2
rev: v2.4.1
hooks:
- id: codespell
name: Check source code spelling
stages: [commit]
stages: [pre-commit]
- id: codespell
name: Check commit message spelling
stages: [commit-msg]
......
......@@ -6,7 +6,7 @@ In the interest of fostering an open and welcoming environment, we as Software
Heritage contributors and maintainers pledge to making participation in our
project and our community a harassment-free experience for everyone, regardless
of age, body size, disability, ethnicity, sex characteristics, gender identity
and expression, level of experience, education, socio-economic status,
and expression, level of experience, education, socioeconomic status,
nationality, personal appearance, race, religion, or sexual identity and
orientation.
......
[mypy]
namespace_packages = True
warn_unused_ignores = True
explicit_package_bases = True
# ^ Needed for mypy to detect py.typed from swh packages installed
# in editable mode
# 3rd party libraries without stubs (yet)
[mypy-breezy.*]
ignore_missing_imports = True
[mypy-celery.*]
ignore_missing_imports = True
[mypy-pkg_resources.*]
ignore_missing_imports = True
[mypy-pytest.*]
ignore_missing_imports = True
......@@ -46,7 +46,7 @@ build-backend = "setuptools.build_meta"
fallback_version = "0.0.1"
[tool.black]
target-version = ['py37']
target-version = ['py39', 'py310', 'py311', 'py312']
[tool.isort]
multi_line_output = 3
......@@ -57,3 +57,35 @@ ensure_newline_before_comments = true
line_length = 88
force_sort_within_sections = true
known_first_party = ['swh']
[tool.mypy]
namespace_packages = true
warn_unused_ignores = true
explicit_package_bases = true
# ^ Needed for mypy to detect py.typed from swh packages installed
# in editable mode
plugins = []
# 3rd party libraries without stubs (yet)
# [[tool.mypy.overrides]]
# module = [
# "package1.*",
# "package2.*",
# ]
# ignore_missing_imports = true
[tool.flake8]
select = ["C", "E", "F", "W", "B950"]
ignore = [
"E203", # whitespaces before ':' <https://github.com/psf/black/issues/315>
"E231", # missing whitespace after ','
"E501", # line too long, use B950 warning from flake8-bugbear instead
"W503" # line break before binary operator <https://github.com/psf/black/issues/52>
]
max-line-length = 88
[tool.pytest.ini_options]
norecursedirs = "build docs .*"
asyncio_mode = "strict"
consider_namespace_packages = true
[pytest]
norecursedirs = build docs .*
asyncio_mode = strict
consider_namespace_packages = true
swh.model >= 2.6.1
swh.model >= 6.13.0
swh.storage >= 0.41.1
swh.scheduler >= 0.23.0
swh.loader.core >= 5.7.3
celery-types
dulwich
pytest >= 8.1
pytest-mock
swh.core[testing]
swh.scheduler[testing]
swh.storage[testing]
swh.loader.core[testing]
swh.scheduler[pytest] >= 3.1.0
swh.storage[pytest] >= 3.1.0
testtools
......@@ -2,4 +2,4 @@
# should match https://pypi.python.org/pypi names. For the full spec or
# dependency lines, see https://pip.readthedocs.org/en/1.1/requirements.html
breezy >= 3.3.1, != 3.3.6, != 3.3.7 # use versions with available binary wheels
breezy >= 3.3.1, != 3.3.6, != 3.3.7, != 3.3.8, != 3.3.9, != 3.3.10, != 3.3.11 # use versions with available binary wheels
[flake8]
# E203: whitespaces before ':' <https://github.com/psf/black/issues/315>
# E231: missing whitespace after ','
# E501: line too long, use B950 warning from flake8-bugbear instead
# W503: line break before binary operator <https://github.com/psf/black/issues/52>
select = C,E,F,W,B950
ignore = E203,E231,E501,W503
max-line-length = 88
......@@ -40,7 +40,7 @@ from swh.model.model import (
Sha1Git,
Snapshot,
SnapshotBranch,
TargetType,
SnapshotTargetType,
Timestamp,
TimestampWithTimezone,
)
......@@ -219,9 +219,9 @@ class BazaarLoader(BaseLoader):
extid_version=EXTID_VERSION,
):
extids.append(extid)
self._revision_id_to_sha1git[
BzrRevisionId(extid.extid)
] = extid.target.object_id
self._revision_id_to_sha1git[BzrRevisionId(extid.extid)] = (
extid.target.object_id
)
if extids:
# Filter out dangling extids, we need to load their target again
......@@ -350,7 +350,7 @@ class BazaarLoader(BaseLoader):
snp_target = self._get_revision_id_from_bzr_id(target)
snapshot_branches[label] = SnapshotBranch(
target=self.store_release(tag_name, snp_target),
target_type=TargetType.RELEASE,
target_type=SnapshotTargetType.RELEASE,
)
if self.branch.last_revision() != NULL_REVISION:
......@@ -358,11 +358,11 @@ class BazaarLoader(BaseLoader):
self.branch.last_revision()
)
snapshot_branches[b"trunk"] = SnapshotBranch(
target=head_revision_git_hash, target_type=TargetType.REVISION
target=head_revision_git_hash, target_type=SnapshotTargetType.REVISION
)
snapshot_branches[b"HEAD"] = SnapshotBranch(
target=b"trunk",
target_type=TargetType.ALIAS,
target_type=SnapshotTargetType.ALIAS,
)
snapshot = Snapshot(branches=snapshot_branches)
......
......@@ -687,7 +687,7 @@ class TestBzrLoader(TestCaseWithTransport):
repo_url = self.get_url()
res = BazaarLoader(self.swh_storage, repo_url, directory=repo_url).load()
assert res == {"status": "failed"}
assert res["status"] == "failed"
def test_empty_dirs_are_preserved(self):
working_tree = self.make_branch_and_tree(".")
......
......@@ -22,16 +22,18 @@ commands =
[testenv:black]
skip_install = true
deps =
black==23.1.0
black==25.1.0
commands =
{envpython} -m black --check swh
[testenv:flake8]
skip_install = true
deps =
flake8==5.0.4
flake8-bugbear==22.9.23
pycodestyle==2.9.1
flake8==7.1.1
flake8-bugbear==24.12.12
flake8-pyproject==1.2.3
pycodestyle==2.12.1
commands =
{envpython} -m flake8
......@@ -39,7 +41,7 @@ commands =
extras =
testing
deps =
mypy==1.8.0
mypy==1.15.0
commands =
mypy swh
......