pypa / pypa/setuptools

Rely on importlib2 and PEP 420 for namespace packages

Open
#406 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

critical enhancement Needs Triage
Dominant language
Python
Stars
2.9k
Forks
1.4k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

Originally reported by: jaraco (Bitbucket: jaraco, GitHub: jaraco)


In this comment, @ncoghlan indicates that it may be possible to get PEP-420 namespace packages on Python 2.7. @rbtcollins indicates that he's worked on this as well with some issues.

I'd like to see setuptools support (and prefer) the PEP 420 model for namespaces. I don't yet have an idea quite what the solution looks like, so I'm opening this discussion here.

Is it possible for setuptools to detect whether the importlib2 hook has been installed on older Pythons? Would that be a sufficient condition in practice to infer that packages could be installed with that model (and eliminate the .pth and other init.py techniques)?

As a solution for this issue would likely address issues with namespace packages between different installation models, I'm marking it as higher priority.


Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked discussion and investigate how setuptools currently handles namespace packages on Python 2.7, including whether an importlib2 hook can be detected. Done requires a decided approach for preferring PEP 420 namespaces and a clear scope for replacing the existing .pth and init.py techniques.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.