Skip to content

support absolute --config-path (#2368) #2395

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

Merged
merged 1 commit into from
Oct 4, 2022
Merged

Conversation

pixelb
Copy link
Contributor

@pixelb pixelb commented Sep 29, 2022

This was actually already supported as
os.path.join("/blah", "/abs/config"), just returns "/abs/config", but we've made this explicit in code and docs now.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 29, 2022
os.path.abspath("tests/test_apps/app_with_multiple_config_dirs/dir2"),
],
)
@mark.parametrize("config_name", ["cfg1", "cfg2", "cfg2"])
Copy link
Collaborator

@Jasha10 Jasha10 Sep 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@mark.parametrize("config_name", ["cfg1", "cfg2", "cfg2"])
@mark.parametrize("config_name", ["cfg1", "cfg2"])

No need for the additional "cfg2" here. Since there are two separate mark.parametrize decorators, pytest will test against the product of the iterators, as if running a nested for loop:

for config_path in ["dir1", "dir2", os.abspath(...)]:
    for config_name in ["cfg1", "cfg2"]:
        ...  # test code here

Copy link
Collaborator

@Jasha10 Jasha10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation looks good to me!
A few nits:

  • news fragment
  • could benefit from a test case in tests/test_config_search_path.py:test_compute_search_path_dir

This was actually already supported as
os.path.join("/blah", "/abs/config"), just returns "/abs/config",
but we've made this explicit in code and docs now.
@pixelb pixelb merged commit 76d63c6 into facebookresearch:main Oct 4, 2022
@pixelb pixelb deleted the i-2368 branch October 4, 2022 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Option to specify the arg --config-path, -cp as an absolute path
3 participants