Skip to content

remove pycache files from sdist package - #16

Merged
jquast merged 1 commit into
mainfrom
jq/remove-pycache-from-sdist
Jul 3, 2026
Merged

remove pycache files from sdist package#16
jquast merged 1 commit into
mainfrom
jq/remove-pycache-from-sdist

Conversation

@jquast

@jquast jquast commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

when building jinxed-2.1.0 for pypi release and checking file contents, i was surprised to see the
__pycache__ folder and contents, this is from "graft tests" in MANIFEST.in, which includes
everything:

jinxed-2.1.0/tests/__pycache__/
jinxed-2.1.0/tests/__pycache__/__init__.cpython-313.pyc
jinxed-2.1.0/tests/__pycache__/__init__.cpython-314.pyc
jinxed-2.1.0/tests/__pycache__/test_terminal.cpython-313.pyc
jinxed-2.1.0/tests/__pycache__/test_terminal.cpython-314-pytest-9.0.3.pyc
jinxed-2.1.0/tests/__pycache__/test_terminal.cpython-314.pyc
jinxed-2.1.0/tests/__pycache__/test_terminfo.cpython-313.pyc
jinxed-2.1.0/tests/__pycache__/test_terminfo.cpython-314.pyc
jinxed-2.1.0/tests/__pycache__/test_tparm.cpython-313.pyc
jinxed-2.1.0/tests/__pycache__/test_tparm.cpython-314.pyc

These kinds of tests/__pycache__/ and .pyc and pypy files have been in every past jinxed
sdist release except for 1.4.0 and this most recent one, 2.1.0 where it was noticed and manually
removed before publishing.

Added global-exclude for pycache files to MANIFEST.in to prevent it.

Summary by Sourcery

Build:

  • Add a global exclude rule in MANIFEST.in to omit pycache directories and .pyc files from the sdist package.

when building jinxed-2.1.0 for pypi release and checking file contents,
i was surprised to see the ``__pycache__`` folder and contents, this is
from "graft tests", which includes everything, even ``.pyc`` files:

    jinxed-2.1.0/tests/__pycache__/
    jinxed-2.1.0/tests/__pycache__/__init__.cpython-313.pyc
    jinxed-2.1.0/tests/__pycache__/__init__.cpython-314.pyc
    jinxed-2.1.0/tests/__pycache__/test_terminal.cpython-313.pyc
    jinxed-2.1.0/tests/__pycache__/test_terminal.cpython-314-pytest-9.0.3.pyc
    jinxed-2.1.0/tests/__pycache__/test_terminal.cpython-314.pyc
    jinxed-2.1.0/tests/__pycache__/test_terminfo.cpython-313.pyc
    jinxed-2.1.0/tests/__pycache__/test_terminfo.cpython-314.pyc
    jinxed-2.1.0/tests/__pycache__/test_tparm.cpython-313.pyc
    jinxed-2.1.0/tests/__pycache__/test_tparm.cpython-314.pyc

These kinds of ``tests/__pycache__/`` and ``.pyc`` and pypy files have
been in every past jinxed sdist release except for 1.4.0 and this most
recent one, 2.1.0 where it was noticed and manually removed before
publishing.

Added global-exclude for pycache files to MANIFEST.in to prevent it.
@sourcery-ai

sourcery-ai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates packaging configuration so that Python bytecode and pycache artifacts from tests are excluded from source distributions.

File-Level Changes

Change Details Files
Exclude pycache and Python bytecode artifacts from the sdist produced by setuptools.
  • Add a global-exclude rule in MANIFEST.in to filter out pycache directories and .pyc/.pyo files from packaged sources, including under tests/
  • Ensure future sdist builds no longer contain cached bytecode files that were previously pulled in via the existing 'graft tests' rule
MANIFEST.in

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (04490f1) to head (cc84b10).

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #16   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           57        57           
  Lines          710       710           
  Branches        31        31           
=========================================
  Hits           710       710           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@avylove avylove left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Good catch!

@jquast
jquast merged commit 55bd866 into main Jul 3, 2026
35 checks passed
@jquast
jquast deleted the jq/remove-pycache-from-sdist branch July 3, 2026 16:24
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.

2 participants