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

pika.compat should be a module, not package #978

Merged
merged 1 commit into from
Feb 27, 2018

Conversation

lukebakken
Copy link
Member

Fixes the issue raised here:

#945 (comment)

@lukebakken lukebakken added this to the 1.0.0 milestone Feb 26, 2018
@lukebakken lukebakken self-assigned this Feb 26, 2018
@codecov
Copy link

codecov bot commented Feb 26, 2018

Codecov Report

Merging #978 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #978   +/-   ##
======================================
  Coverage    82.5%   82.5%           
======================================
  Files          19      19           
  Lines        3779    3779           
  Branches      567     567           
======================================
  Hits         3118    3118           
  Misses        508     508           
  Partials      153     153
Impacted Files Coverage Δ
pika/compat.py 84.31% <ø> (ø)
pika/adapters/blocking_connection.py 85.75% <0%> (-0.28%) ⬇️
pika/adapters/base_connection.py 64.86% <0%> (+0.77%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 173ce21...48d8339. Read the comment docs.

Copy link
Member

@vitaly-krugl vitaly-krugl left a comment

Choose a reason for hiding this comment

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

Looks good. But I didn't quite understand why the package compat didn't work in #945. Would you mind elaborating?

@lukebakken lukebakken merged commit 973ebc3 into master Feb 27, 2018
@lukebakken lukebakken deleted the pika-compat-as-module branch February 27, 2018 02:40
@anton-ryzhov
Copy link
Contributor

@vitaly-krugl because distutils installs only packages listed under packages keyword in setup.py. compat.py was a part of pika package, but compat/__init__.py is a new pika.compat package, different than just pika.
If you add new [sub]packages, you must list it in setup.py. Or use http://setuptools.readthedocs.io/en/latest/setuptools.html#using-find-packages

@vitaly-krugl
Copy link
Member

because distutils installs only packages listed under packages keyword

So, one option was to list compat/__init__.py in setup.py instead of turning it into compat module? Just curious.

@anton-ryzhov
Copy link
Contributor

Yes, sure, like this:

setuptools.setup(
    …
    packages=['pika', 'pika.adapters', 'pika.compat'],
    …
)

or even better (autodiscovery):

from setuptools import find_packages

setuptools.setup(
    …
    packages=find_packages(exclude=['*.tests', '*.tests.*', 'tests.*', 'tests']),
    …
)

@lukebakken
Copy link
Member Author

@vitaly-krugl apologies that I missed your question and thank you @anton-ryzhov for answering it.

@vitaly-krugl
Copy link
Member

Thanks @anton-ryzhov!

@lukebakken - I like the find_packages() recommendation for auto-discovery. What do you think?

@lukebakken
Copy link
Member Author

I doubt Pika will add packages in the future. The issue around compat was all my mistake in thinking it had to be a package.

lukebakken added a commit that referenced this pull request Apr 13, 2018
pika.compat should be a module, not package

(cherry picked from commit 973ebc3)
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