Skip to content

[build] Remove setup_requires and tests_require from setup.py for FULL_CAFFE2#10530

Closed
orionr wants to merge 2 commits intopytorch:masterfrom
orionr:remove-setup-requires
Closed

[build] Remove setup_requires and tests_require from setup.py for FULL_CAFFE2#10530
orionr wants to merge 2 commits intopytorch:masterfrom
orionr:remove-setup-requires

Conversation

@orionr
Copy link
Contributor

@orionr orionr commented Aug 15, 2018

In my environment, it looks like setup.py hangs when running

FULL_CAFFE2=1 python setup.py build_deps

Removing this fixes things, but we might also want to look at tests_require, which came over from setup_caffe2.py.

cc @pjh5

@ezyang
Copy link
Contributor

ezyang commented Aug 15, 2018

This is on a devserver? Usually a hang is because your proxy settings are wrong.

(Anyway, I agree: cool build systems don't connect to the network when you run them.)

@pjh5
Copy link
Contributor

pjh5 commented Aug 15, 2018

I think @ezyang is right, it'll try to install these packages before it starts building. But this wasn't buying us much anyways

@Yangqing
Copy link
Contributor

Yangqing commented Aug 15, 2018

Which packages is it trying to install? Is it due to the NNPACK dependency?

IIRC, nnpack has a few dependency download here: https://github.com/Maratyszcza/NNPACK/tree/master/cmake

@Yangqing
Copy link
Contributor

Also, I am a bit curious why we need pytest-runner for setup, since we don't run test during setup time I think...?

@bddppq
Copy link
Contributor

bddppq commented Aug 15, 2018

This (and also test_requires) is for delegating python setup.py test to pytest: https://docs.pytest.org/en/latest/goodpractices.html#integrating-with-setuptools-python-setup-py-test-pytest-runner. I think it's fine to remove it because IIRC pytest doesn't really work in pytorch.

@orionr
Copy link
Contributor Author

orionr commented Aug 15, 2018

Good point @ezyang - likely proxy in this case. git should be setup correctly, so hopefully NNPACK is a non-issue. Generally, I would like to avoid network calls when running this, though, since it's a bit weird to do so. @bddppq and @pjh5 should I remove test_requires as well?

@ezyang
Copy link
Contributor

ezyang commented Aug 15, 2018

A few points:

  1. PyTorch does work with pytest, at least if you use pytest to invoke tests individually. I've used it in the past because it's test filtering is superior to the default Python test runner

  2. There isn't really any reason we should force pytest-runner on users on install: it's just for tests (so, if a user is not interested in running tests, it will still try to install it), and it's not even essential to run tests (you can always use the default runner)

So, I support this patch as written, just not for the reasons originally proffered.

@bddppq
Copy link
Contributor

bddppq commented Aug 15, 2018

@ezyang pytest does not work in PyTorch when invoking from the root directory if tests are not invoked individually.

@orionr
Copy link
Contributor Author

orionr commented Aug 15, 2018

At this point I'm going to remove tests_require too. I'm a bit concerned about all of the additional deps in install_requires as well, especially since we want to have FULL_CAFFE2=1 in all cases shortly. Is it better to just not have these (similar to PyTorch) and just have the user install them as needed? Or, alternatively, have them in requirements.txt. I like that last option, honestly.

@orionr orionr changed the title [build] Remove setup_requires from setup.py for FULL_CAFFE2 [build] Remove setup_requires and test_requires from setup.py for FULL_CAFFE2 Aug 15, 2018
@orionr orionr changed the title [build] Remove setup_requires and test_requires from setup.py for FULL_CAFFE2 [build] Remove setup_requires and tests_require from setup.py for FULL_CAFFE2 Aug 15, 2018
@pjh5
Copy link
Contributor

pjh5 commented Aug 15, 2018

I think that install_requires affects wheel installs, causing pip to install the needed dependencies before installing the wheel. It can be moved to requirements.txt as well, though I think requirements.txt is simply convention and not used by pip itself

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

orionr is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

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.

6 participants