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 __file__ for paths instead of sys.path #2

Merged
merged 1 commit into from
Jun 14, 2021
Merged

Conversation

jbitton
Copy link
Contributor

@jbitton jbitton commented Jun 14, 2021

Using sys.path to determine the paths in base_paths.py is hacky and only works if your Python path is set very specifically.

Instead let's get the file paths in base_paths.py by using __file__ and getting the parent directories' names :)

Ran transforms test for each modality to ensure everything runs as expected:

$ ~/anaconda3/envs/augly/bin/python -m unittest augly.tests.text_tests.transforms_unit_tests
----------------------------------------------------------------------
Ran 12 tests in 0.013s

OK
$ ~/anaconda3/envs/augly/bin/python -m unittest augly.tests.image_tests.transforms_unit_tests
----------------------------------------------------------------------
Ran 39 tests in 14.366s

OK
$ ~/anaconda3/envs/augly/bin/python -m unittest augly.tests.audio_tests.transforms_unit_tests
----------------------------------------------------------------------
Ran 24 tests in 7.878s

OK

$ ~/anaconda3/envs/augly/bin/python -m unittest augly.tests.video_tests.transforms.composite_tests

----------------------------------------------------------------------
Ran 11 tests in 29.982s

OK

@jbitton jbitton requested a review from zpapakipos June 14, 2021 19:06
@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 Jun 14, 2021
@jbitton jbitton merged commit 1f5aca2 into main Jun 14, 2021
@jbitton jbitton deleted the fix-base-paths branch June 14, 2021 20:32
lyakaap pushed a commit to lyakaap/AugLy that referenced this pull request Jan 19, 2022
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.

None yet

3 participants