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

Improved handling of module __path__ attribute for namespace packages, fixes #1321 #1402

Merged
merged 6 commits into from
Sep 16, 2018
Merged

Improved handling of module __path__ attribute for namespace packages, fixes #1321 #1402

merged 6 commits into from
Sep 16, 2018

Conversation

daa
Copy link
Contributor

@daa daa commented Jun 27, 2018

Summary of changes

Improved __path__ attribute handling for namespace packages, fixes a bug revealed with python3.6 when there are 2 packages in the same namespace one installed and one in current working directory.

Closes #1321

Pull Request Checklist

  • Changes have tests
  • News fragment added in changelog.d.

@@ -109,3 +109,34 @@ def test_namespace_package_installed_and_cwd(self, tmpdir):
]
with test.test.paths_on_pythonpath([str(target)]):
subprocess.check_call(pkg_resources_imp, cwd=str(pkg_A))

@pytest.mark.skipif(bool(os.environ.get("APPVEYOR")),
Copy link
Member

Choose a reason for hiding this comment

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

No need for the bool here.

Also, can you make this xfail? This test should pass on Appveyor, so it would be good to know if it changes from xfail to xpass.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I noticed that in appveyor run for this pull request 3 of 4 namespace tests passed when running under python-2.7.15 and all 4 passed when running under python-3.6.6. Should I remove xfail for them?

Copy link
Member

Choose a reason for hiding this comment

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

@daa The rest of the repo is not super consistent about xfail vs skip. Going forward we're trying to make a clear distinction, and at some point I'll go through and try and clean it up so that we can turn on strict xfail (e.g. if an xfail test succeeds, that's a failure).

Copy link
Member

Choose a reason for hiding this comment

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

Oh sorry, I misunderstood. Yeah, I think you should change these so that you don't introduce any new XPASSes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I removed xfail marks for namespace tests that pass on AppVeyor.

@pytest.mark.xfail(
os.environ.get("APPVEYOR"),
reason="https://github.com/pypa/setuptools/issues/851",
)
Copy link
Member

Choose a reason for hiding this comment

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

I think you can drop the APPVEYOR xfail entirely, since it seems that this test is only failing on Appveyor for Python 2.7, which is covered by the xfail anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, removed.

@jaraco
Copy link
Member

jaraco commented Sep 16, 2018

The diff indicates #851 may be addressed by this change also.

@jaraco
Copy link
Member

jaraco commented Sep 16, 2018

Thank you for this.

@jaraco jaraco merged commit 5c8ff5a into pypa:master Sep 16, 2018
@daa
Copy link
Contributor Author

daa commented Sep 16, 2018

Thank you for merging.

ikalnytskyi added a commit to sphinx-contrib/openapi that referenced this pull request Aug 10, 2019
Unfortunately, Travis CI uses a pretty outdated version of setuptools
package in Python 3.6 environments. That version has a bug that prevents
using namespace packages [1]. Fortunately, it has been fixed in newer
versions, thus we simply must update a setuptools version.

pypa/setuptools#1402
ikalnytskyi added a commit to sphinx-contrib/openapi that referenced this pull request Aug 11, 2019
Unfortunately, Travis CI uses a pretty outdated version of setuptools
package in Python 3.6 environments. That version has a bug that prevents
using namespace packages [1]. Fortunately, it has been fixed in newer
versions, thus we simply must update a setuptools version.

pypa/setuptools#1402
glance- pushed a commit to glance-/docker-jenkins-job that referenced this pull request Sep 18, 2019
This was probably fixed in 40.3 with pypa/setuptools#1402

This reverts commit 0e96193.
glance- pushed a commit to glance-/docker-jenkins-job that referenced this pull request Sep 25, 2019
This was probably fixed in 40.3 with pypa/setuptools#1402

This reverts commit 0e96193.
johanlundberg pushed a commit to SUNET/docker-jenkins-job that referenced this pull request Oct 22, 2019
This was probably fixed in 40.3 with pypa/setuptools#1402

This reverts commit 0e96193.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants