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

use relative paths in config file #78

Merged
merged 9 commits into from
Nov 8, 2023
Merged

use relative paths in config file #78

merged 9 commits into from
Nov 8, 2023

Conversation

dennisvang
Copy link
Owner

Use relative paths (i.e. relative to current working directory) for repo_dir and keys_dir in config file, if possible.
The config file itself is also in cwd.

Fixes #50

Although using paths that are *not* relative to the current working directory (cwd) is discouraged,
this *should* still be possible. So, if the path is not relative to cwd, we just save the absolute path.
@dennisvang dennisvang self-assigned this Sep 5, 2023
@dennisvang
Copy link
Owner Author

dennisvang commented Sep 5, 2023

Hm... Looks like I'm running into something similar to actions/runner-images#712 again...

Windows truncates the username with a tilde (~1):

C:\Users\runneradmin\ becomes C:\Users\RUNNER~1\

but pathlib does not recognize that these are the same.

See 8.3 alias, this post, and wikipedia.

Looks like this is related: python/cpython#73181

Maybe this can resolve() the issue?

For example, instead of

self.assertEqual(path_a, path_b)

we would use

self.assertEqual(path_a.resolve(), path_b.resolve())

@dennisvang
Copy link
Owner Author

... and we appear to be running into python/cpython#82852 for python <3.10 on windows

@dennisvang dennisvang merged commit 5f0bddb into master Nov 8, 2023
11 checks passed
@dennisvang dennisvang changed the title Fix issue 50: use relative paths in config file use relative paths in config file Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use relative paths in .tufup-repo-config
1 participant