Skip to content

Conversation

d4l3k
Copy link
Member

@d4l3k d4l3k commented May 5, 2021

This adds the standard github python .gitignore file: https://github.com/github/gitignore/blob/master/Python.gitignore

It also adds a bunch of init.py files so all the existing tests are correctly discovered and run:

python setup.py test

@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 May 5, 2021
@facebook-github-bot
Copy link
Contributor

@d4l3k has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@d4l3k merged this pull request in 4b6a606.

facebook-github-bot pushed a commit that referenced this pull request Oct 5, 2021
…inding penv.par, add a CWD/penv.par search fallback to handle unittest @mode/opt (#216)

Summary:
Pull Request resolved: #216

Fixes the following two scenarios:

#1
```
~/bin
    - python
    - penv.par

$ cd ~/bin
$ ./python -m mo.du.le
```
Does not pick up `~/bin/penv.par` (as expected) because `sys.argv[0] = ./python`. Fix is to return `(Path(sys.argv[0])/"penv.par").absolute() `

#2
Using this interpreter as a unittest resource + torchx local_cwd scheduler does not resolve penv.par from the test source dir since the symlink is resolved by unix and `sys.argv[0]` is set to the actual interpreter (not the symlinked one)
```
python_unittest(
   name="foo_test",
   resource={
       "//torchx/fb:python": "python",
       "//torchx/apps:penv": "penv.par",
   }
   ...
)

# buck run mode/opt //foo_test
# outputs in build dir

~/fbcode/buck-out/opt/gen/foo_test#link-tree/
    - python -> buck-out/opt/gen/torchx/fb/python.par
    - penv.par
```
Hence with the current penv par lookup logic we end up looking for a penv.par in `buck-out/opt/gen/torchx/fb/penv.par` which does not exist and we just simply fall back to system python.

Reviewed By: aivanou

Differential Revision: D31402466

fbshipit-source-id: 257d9aa53033a306f3e8fa2653ccc6ba7089d90d
KPostOffice referenced this pull request in KPostOffice/torchx Apr 11, 2023
Signed-off-by: Kevin <kpostlet@redhat.com>
KPostOffice referenced this pull request in KPostOffice/torchx Apr 12, 2023
Signed-off-by: Kevin <kpostlet@redhat.com>
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. Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants