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

Add archive.rds and expand package path to allow archived versions of R packages #58

Merged
merged 2 commits into from
Aug 9, 2024
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
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"]