Automatically `normalizePath()` for local type of references

Open
#378 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
r
Domain
tooling

Research direction

Begin with pkgdepends::pkg_refs() and the path handling reached by pak::pak(); compare the relative local reference example with normalizePath() output. Done means supported local references are automatically normalized and the shown pak::pak("../pkg2") case succeeds, with coverage for this behavior.

Written by the indexing model from the issue text.

Description

feature

Given the following file structure:

my_packages/
├── pkg1
├── pkg2
├── pkg3
└── ...

I usually do:

setwd("my_packages/pkg1")

And then want to do the following:

pak::pak("../pkg2")

But it results in the following error:

Error: 
! error in pak subprocess
Caused by error in `get_remote_types(refs)`:
! Cannot parse package:
../pkg2.
ℹ See `?pkgdepends::pkg_refs()` for supported
  package sources.
Type .Last.error to see the more details.

The solution is to convert the path to be in absolute form via normalizePath(). This is definitely not the end of the world but involves a lot of typing given how short&sweet the pak::pak() command is.

My request is: can it be done automatically (for all local type of reference)?

Dominant language
C
Stars
135
Forks
47
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from r-lib/pkgdepends

All issues in r-lib/pkgdepends

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.