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 MANIFEST.in to include files in source distro #168

Merged
merged 1 commit into from
May 31, 2019

Conversation

lukpueh
Copy link
Member

@lukpueh lukpueh commented May 17, 2019

Fixes issue #:
#166

Description of the changes being introduced by the pull request:
MANIFEST.in is used to specify files (patterns) to be added to the source distribution (e.g. on python setup.py sdist) in addition to files that are added by default.

This PR configures MANIFEST.in to add files that are important/helpful for downstream packagers, i.e. readme, license, tests and test data and config.

Kudos to @koobs for bringing this to our attention.

Please verify and check that the pull request fulfills the following
requirements
:

  • The code follows the Code Style Guidelines
  • Tests have been added for the bug fix or new feature
  • Docs have been added for the bug fix or new feature

MANIFEST.in is used to specify files (patterns) to be added to
the source distribution (e.g. on `python setup.py sdist`) in
addition to files that are added by default.

This commit configures MANIFEST.in to add files that are
important/helpful for downstream packagers, i.e. readme, license,
tests and test data and config.

Kudos to @koobs for bringing this to our attention.
@koobs
Copy link

koobs commented May 17, 2019

Much appreciated @lukpueh

@lukpueh lukpueh requested a review from JustinCappos May 31, 2019 09:40
@awwad
Copy link
Contributor

awwad commented May 31, 2019

Checking myself:
IIUC, MANIFEST.in allows additional inclusions when building the sdist, beyond setup.py's inclusions (which for this repo currently are just the packages found in the repo by distutils, with the tests and debian directories excluded).

Given that:

The README.rst and LICENSE inclusions are good, for sure.

Is it typical to include tests in an sdist? This PR does. I'm not sure what best policies are regarding including the travis and coverage settings in the sdist. I'm not sure what the use is for those. But that's obviously not a big deal.

So LGTM. 👍

@awwad awwad self-requested a review May 31, 2019 15:36
Copy link
Contributor

@awwad awwad left a comment

Choose a reason for hiding this comment

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

👍 See comments

@lukpueh
Copy link
Member Author

lukpueh commented May 31, 2019

... not sure what best policies

IMHO @koobs has compelling arguments in #166.

Thanks for the review, @awwad

@lukpueh lukpueh merged commit f466266 into secure-systems-lab:master May 31, 2019
@koobs
Copy link

koobs commented Jun 1, 2019

Note: that setup.py already contained packages = find_packages(exclude=['tests', 'debian']), which excludes these packages from being installed (a good thing)

Thank you for taking care of this

lukpueh added a commit that referenced this pull request Jun 18, 2019
The debian release is only one of many releases, thus non-native
makes more sense

Further details at:
- https://wiki.debian.org/DebianMentorsFaq#What_is_the_difference_between_a_native_Debian_package_and_a_non-native_package.3F
- https://wiki.debian.org/Packaging/Intro#The_packaging_work_flow

Debian build instructions for upstream release 0.11.3
-----------------------------------------------------
```
  # Assuming sbuild is installed and chroot is created
  # https://wiki.debian.org/sbuild

  # Download upstream tarball + signature and rename to expected pattern
  wget https://github.com/secure-systems-lab/securesystemslib/releases/download/sslibv0.11.3/securesystemslib-0.11.3.tar.gz \
      -O python-securesystemslib_0.11.3.orig.tar.gz
  wget https://github.com/secure-systems-lab/securesystemslib/releases/download/sslibv0.11.3/securesystemslib-0.11.3.tar.gz.asc \
      -O python-securesystemslib_0.11.3.orig.tar.gz.asc

  # Extract upstream tarball
  tar xf python-securesystemslib_0.11.3.orig.tar.gz

  # Clone upstream repo for debian files and tests
  git clone https://github.com/secure-systems-lab/securesystemslib.git \
      securesystemslib-upstream

  # Copy debian files (from debian branch)
  git -C securesystemslib-upstream checkout debian --
  cp -r securesystemslib-upstream/debian securesystemslib-0.11.3/

  # Change to unpacked tarball
  cd securesystemslib-0.11.3

  ##################
  # Optionally copy and run tests (from corresponding release tag)
  # NOTE: The next upstream release will include tests in the source tarball
  # see #168
  git -C ../securesystemslib-upstream checkout sslibv0.11.3
  cp -r ../securesystemslib-upstream/tests .
  # FIXME: Sbuild will complain about local changes and abort building. One way
  # to solve this is to create downstream patches, but there must be a better way
  # to only run tests in chroot as sbuild would do it, without including the
  # tests to the downstream release.
  dpkg-source --commit
  sbuild -A -s -d unstable
  ##################

  # Build (w/o tests)
  DEB_BUILD_OPTIONS=nocheck sbuild -A -s -d unstable

  # Sign debian files (replace keyid if necessary)
  debsign -k 8BA69B87D43BE294F23E812089A2AD3C07D962E8
```
tanishqjasoria pushed a commit to tanishqjasoria/securesystemslib that referenced this pull request Jan 30, 2020
The debian release is only one of many releases, thus non-native
makes more sense

Further details at:
- https://wiki.debian.org/DebianMentorsFaq#What_is_the_difference_between_a_native_Debian_package_and_a_non-native_package.3F
- https://wiki.debian.org/Packaging/Intro#The_packaging_work_flow

Debian build instructions for upstream release 0.11.3
-----------------------------------------------------
```
  # Assuming sbuild is installed and chroot is created
  # https://wiki.debian.org/sbuild

  # Download upstream tarball + signature and rename to expected pattern
  wget https://github.com/secure-systems-lab/securesystemslib/releases/download/sslibv0.11.3/securesystemslib-0.11.3.tar.gz \
      -O python-securesystemslib_0.11.3.orig.tar.gz
  wget https://github.com/secure-systems-lab/securesystemslib/releases/download/sslibv0.11.3/securesystemslib-0.11.3.tar.gz.asc \
      -O python-securesystemslib_0.11.3.orig.tar.gz.asc

  # Extract upstream tarball
  tar xf python-securesystemslib_0.11.3.orig.tar.gz

  # Clone upstream repo for debian files and tests
  git clone https://github.com/secure-systems-lab/securesystemslib.git \
      securesystemslib-upstream

  # Copy debian files (from debian branch)
  git -C securesystemslib-upstream checkout debian --
  cp -r securesystemslib-upstream/debian securesystemslib-0.11.3/

  # Change to unpacked tarball
  cd securesystemslib-0.11.3

  ##################
  # Optionally copy and run tests (from corresponding release tag)
  # NOTE: The next upstream release will include tests in the source tarball
  # see secure-systems-lab#168
  git -C ../securesystemslib-upstream checkout sslibv0.11.3
  cp -r ../securesystemslib-upstream/tests .
  # FIXME: Sbuild will complain about local changes and abort building. One way
  # to solve this is to create downstream patches, but there must be a better way
  # to only run tests in chroot as sbuild would do it, without including the
  # tests to the downstream release.
  dpkg-source --commit
  sbuild -A -s -d unstable
  ##################

  # Build (w/o tests)
  DEB_BUILD_OPTIONS=nocheck sbuild -A -s -d unstable

  # Sign debian files (replace keyid if necessary)
  debsign -k 8BA69B87D43BE294F23E812089A2AD3C07D962E8
```
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.

None yet

3 participants