Skip to content

Commit

Permalink
Merge pull request #58 from craddm/main
Browse files Browse the repository at this point in the history
Add archive.rds and expand package path to allow archived versions of R packages
  • Loading branch information
JimMadge authored Aug 9, 2024
2 parents 442329d + 4f8f6bb commit e08a650
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
18 changes: 17 additions & 1 deletion nexus_allowlist/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,18 @@ def recreate_privileges(
)
cran_privilege_names.append(privilege_name)

# Content selector and privilege for CRAN 'archive.rds' file which contains an
# metadata for all archived packages
privilege_name = create_content_selector_and_privilege(
nexus_api,
name="archive",
description="Allow access to 'archive.rds' file in CRAN repository",
expression='format == "r" and path=="/src/contrib/Meta/archive.rds"',
repo_type=_NEXUS_REPOSITORIES["cran_proxy"].repo_type,
repo=_NEXUS_REPOSITORIES["cran_proxy"].name,
)
cran_privilege_names.append(privilege_name)

# Create content selectors and privileges for packages according to the
# package setting
if packages == "all":
Expand Down Expand Up @@ -216,7 +228,11 @@ def recreate_privileges(
nexus_api,
name=f"cran-{package}",
description=f"allow access to {package} on CRAN",
expression=f'format == "r" and path=^"/src/contrib/{package}_"',
expression=(
'format == "r" '
f'and (path=^"/src/contrib/{package}_" '
f'or path=^"/src/contrib/Archive/{package}/{package}_")'
),
repo_type=_NEXUS_REPOSITORIES["cran_proxy"].repo_type,
repo=_NEXUS_REPOSITORIES["cran_proxy"].name,
)
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ all = [
[tool.black]
target-version = ["py310", "py311"]

[tool.ruff]
[tool.ruff.lint]
select = [
"A",
"ARG",
Expand Down Expand Up @@ -91,12 +91,12 @@ unfixable = [
"F401",
]

[tool.ruff.isort]
[tool.ruff.lint.isort]
known-first-party = ["nexus_allowlist"]

[tool.ruff.flake8-tidy-imports]
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
# Tests can use magic values, assertions, and relative imports
"tests/**/*" = ["PLR2004", "S101", "TID252"]

0 comments on commit e08a650

Please sign in to comment.