From 1a635865e4415f011d970be47452dc64f5bbe0f1 Mon Sep 17 00:00:00 2001 From: Kyle McCormick Date: Wed, 5 Oct 2022 12:07:08 -0400 Subject: [PATCH] build: add missing files to PyPI distribution (v3.3.0) (#140) 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. --- .gitignore | 1 + MANIFEST.in | 5 +++++ codejail/__init__.py | 2 +- setup.py | 9 +++++++-- 4 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 MANIFEST.in diff --git a/.gitignore b/.gitignore index 6ca5e9fb0..bb15a67fe 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ coverage.xml htmlcov reports/* .tox/* +/dist # Editor detritus *~ diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 000000000..db4bc1786 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,5 @@ +include LICENSE.txt +include README.rst +include requirements/* +include apparmor-profiles/* +include sudoers-file/* diff --git a/codejail/__init__.py b/codejail/__init__.py index eef78adac..f677fa474 100644 --- a/codejail/__init__.py +++ b/codejail/__init__.py @@ -1,3 +1,3 @@ """init""" -__version__ = '3.2.0' +__version__ = '3.3.0' diff --git a/setup.py b/setup.py index 2b1b4df62..8c7a9f0f0 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ import os import re -from setuptools import setup +from setuptools import find_packages, setup with open('README.rst') as readme: long_description = readme.read() @@ -36,7 +36,12 @@ def get_version(*file_paths): author='edX', author_email="oscm@edx.org", url='https://github.com/openedx/codejail', - packages=['codejail'], + scripts=['proxy_main.py', 'memory_stress.py'], + packages=find_packages( + include=['codejail', 'codejail.*'], + exclude=["*tests"], + ), + include_package_data=True, install_requires=['six'], zip_safe=False, classifiers=[