question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

exclude of setuptools.find_packages is no use

See original GitHub issue

I set packages in setup.py and doing python3 setup.py sdist bdist_wheel to get whl and tar.gz,

setuptools.setup(
    ...
    packages=setuptools.find_packages(exclude=("ictos_common.tests")),
   ...

then into dist and tar zxf *.tar.gz and find the tests is still here .
so I read the source of setuptools and find something wrong .

class PackageFinder:
    """
    Generate a list of all Python packages found within a directory
    """

    @classmethod
    def find(cls, where='.', exclude=(), include=('*',)):
           return list(cls._find_packages_iter(
                   convert_path(where),
                   # something wrong 
                   # cls._build_filter('ez_setup', '*__pycache__', *exclude),
                      cls._build_filter('ez_setup', '*__pycache__', exclude),
                  # something wrong 
                   cls._build_filter(*include)))

modified like this and tests is gone . so maybe this is a bug .

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
xinjiyiercommented, Jul 22, 2020

I see the problem now. You made a typo in constructing tuple literal, e.g. it is ('aaa',) not ('aaa'). I hope that helps.

It is my question,Thank you very much for your reply .

0reactions
McSinyxcommented, Jul 22, 2020

I see the problem now. You made a typo in constructing tuple literal, e.g. it is ('aaa',) not ('aaa'). I hope that helps.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why find_packages(exclude=xxx) does not work when doing ...
I solved the problem by removing the *.egg-info/ directory : it seems that this directory memorized some older settings...
Read more >
Cannot exclude directory · Issue #99 · pypa/wheel - GitHub
I'm unable to exclude a directory 'test', using either MANIFEST.in or setup.py. ... In setup.py: packages=find_packages(exclude=['test', ]),. In each case, sdist ...
Read more >
Package Discovery and Namespace Packages - Setuptools
find: ( ; find_packages() ) takes a source directory and two lists of package name patterns to exclude and include, and then returns...
Read more >
'exclude' packages option in files section of setup.cfg
With 'setuptools.find_packages', we can specify the package names to exclude.
Read more >
How to use the setuptools.find_packages function in ... - Snyk
To help you get started, we've selected a few setuptools.find_packages examples, based on popular ways it is used in public projects.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found