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

Add a setup.py script #1093

Merged
merged 4 commits into from Sep 22, 2016
Merged

Add a setup.py script #1093

merged 4 commits into from Sep 22, 2016

Conversation

lukeyeager
Copy link
Member

@lukeyeager lukeyeager commented Sep 19, 2016

Merge #1091 first

TODO:

  • digits-server doesn't work because it can't find gunicorn_config.py
  • Nothing actually works because the tools/ directory isn't copied
  • Try uploading to PyPI
    • Problems with requirements - will solve later
  • Try simplifying the debian packaging scripts
    • Works great!
  • Stop copying jobs directory around on pip install
    • It still technically works - so we're good to go with packaging
    • For local development, just use pip install -e .

@lukeyeager lukeyeager changed the title [DON'T MERGE] setup.py Add a setup.py script Sep 20, 2016
@lukeyeager
Copy link
Member Author

@gheinrich this seems to be working now. Will you take a look and/or test it with your plugin work?

@gheinrich gheinrich self-assigned this Sep 20, 2016
@lukeyeager
Copy link
Member Author

lukeyeager commented Sep 21, 2016

EDIT: nevermind. We just won't support PyPI for now so as to not rock the boat too much.

Justification for removing requirements{,_test}.txt:

I wanted to leave the requirements files alone, and read them in setup.py like this:

requirements = []
with open(os.path.join(LOCAL_DIR, 'requirements.txt'), 'r') as infile:
    for line in infile:
        line = line.strip()
        if line and not line[0] == '#':  # ignore comments
            requirements.append(line)

setuptools.setup(
    # ...
    install_requires=requirements,
)

That worked fine for local installs, but failed when trying to download from PyPI:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-build-m3gKX_/digits/setup.py", line 13, in <module>
    with open(os.path.join(LOCAL_DIR, 'requirements.txt'), 'r') as infile:
IOError: [Errno 2] No such file or directory: '/tmp/pip-build-m3gKX_/digits/requirements.txt'

Apparently, pip has to re-calculate the requirements based on setup.py at install time, and requirements.txt isn't present at that time. As far as I can tell, there's no way to fix this. So I had to move the requirements specs into setup.py.

This was the most helpful resource I found: https://caremad.io/posts/2013/07/setup-vs-requirement/

@gheinrich
Copy link
Contributor

When I do pip install . after a while the tool exhausts my disk space and I get spates of errors like ('/home/greg/ws/digits/digits/jobs/20160907-011804-d09c', '/tmp/pip-KcNJhU-build/digits/jobs/20160907-011804-d09c', "[Errno 28] No space left on device: '/tmp/pip-KcNJhU-build/digits/jobs/20160907-011804-d09c'"). Is it trying to copy the jobs directory?

pip install -e . is working though and I can add plugins.

@lukeyeager
Copy link
Member Author

Is it trying to copy the jobs directory?

Oh yeah, I forgot about that issue. I gave up on it and just removed all the jobs and the data and the install seems to work fine. I'm not sure this is fix-able. I'll try to dig into it more...

In preparation for setup.py
In preparation for setup.py
In preparation for setup.py
@gheinrich
Copy link
Contributor

That looks OK to me!

@lukeyeager lukeyeager merged commit 3b9cfde into NVIDIA:master Sep 22, 2016
@lukeyeager lukeyeager deleted the setup branch September 22, 2016 22:38
SlipknotTN pushed a commit to cynnyx/DIGITS that referenced this pull request Mar 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants