-
Notifications
You must be signed in to change notification settings - Fork 78
build: add missing files to PyPI distribution (v3.3.0) #140
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
Conversation
7c3fa6e
to
80a74fc
Compare
@nedbat could I trouble you for a review on this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor corrections, then good to go.
MANIFEST.in
Outdated
include requirements/* | ||
include apparmor-profiles/* | ||
include sudoers-file/* | ||
recursive-include {{cookiecutter.sub_dir_name}} *.html *.png *.gif *.js *.css *.jpg *.jpeg *.svg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cookiecutter here seems wrong, and I don't think any of these file types are in this repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, this was just bad copy-pasting on my part:
recursive-include {{cookiecutter.sub_dir_name}} ...
the cookiecutter would've templated that to:
recursive-include codejail ...
Anyway, I'll just remove that line since it's not relevant to us.
MANIFEST.in
Outdated
@@ -0,0 +1,7 @@ | |||
include CHANGELOG.rst |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no CHANGELOG.rst file, though there should be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I missed the memo that we are doing changelogs now. I see them in the cookiecutter but I don't know when that happened. It's not clear to me why we would ever do changelogs and github releases and conventional commits and PR templates. It seems like we're asking developers for a lot of overlapping information.
I'm going to just delete this line for now, but I'll poke arch-bom and pitch the idea of dropping one of those (hopefully GH releases) so we can focus on the things we really care about developers doing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The existing PyPI distribution (edx-codejail 3.2.0) was missing several files that made it unsuitable for installation by edx-platform: * It was missing root scripts: proxy_main.py and memory_stress.py. * It was missing the apparmor-profiles and sudoers-files directories. * It wasn't missing any Python modules under codejail, but *if* any sub-packages had been added to codejail, they would have been omitted from the distribution. This could have bitten someone in the future. To fix, we modify setup.py and add a MANIFEST.in, in line with the pattern established by the cookiecutter repo: https://github.com/openedx/edx-cookiecutters/blob/master/python-template/%7B%7Bcookiecutter.placeholder_repo_name%7D%7D/setup.py This wasn't affecting edx-platform because edx-platform currently does a GitHub-based editable installation (`-e git+https://...`) for codejail. However, we'd like to move away from those editable installations as a they are slow and cannot be kept up-to-date with `make upgrade`. Bump from 3.2.0 to 3.3.0.
80a74fc
to
e42316f
Compare
Thanks @kdmccormick for this effort. |
No problem, glad to help! |
@kdmccormick @nedbat Logs from Staging server: |
Huh, interesting. I think part of the problem is that proxy_main.py isn't packaged or used the way that More specifically, I wonder if we could change edx-platform's call from: python -u proxy_main.py ... to: python -u -m codejail.proxy.proxy_main ... |
I agree the problem is that I used proxy_main.py from the root of the repo rather than installing it properly. It's not quite as simple as changing the command line, because the function takes sys.argv as an argument, but it should be pretty simple. |
Description
The existing PyPI distribution (edx-codejail 3.2.0) was missing several files that made it unsuitable for installation by edx-platform:
To fix, we modify setup.py and add a MANIFEST.in, in line with the pattern established by the cookiecutter repo:
https://github.com/openedx/edx-cookiecutters/blob/master/python-template/%7B%7Bcookiecutter.placeholder_repo_name%7D%7D/setup.py
This wasn't affecting edx-platform because edx-platform currently does a GitHub-based editable installation (
-e git+https://...
) for codejail. However, we'd like to move away from those editable installations as a they are slow and cannot be kept up-to-date withmake upgrade
.Bump from 3.2.0 to 3.3.0.
Testing
Clone codejail at this branch and navigate into it. Create and activate a virtualenv. Then run:
This will drop you into the directory that pip will actually install into edx-platform's virtual environment. Ensure that it contains
proxy_main.py
and that thecodejail
directory contains all the source modules other than the test modules.Some Context
There are three different ways we install packages into edx-platform, in decreasing order of desirability:
base.in
)git+https://...
)-e git+https://
)edx-platform installs codejail using method (3) currently. I'd tried to change it over to method (2) but it failed on edX.org with:
because proxy_main.py was not included in the wheel. This PR fixes that, thus allowing us to install codejail into edx-platform using method (2) or (1).