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

Projects
None yet
3 participants
@lukebakken
Contributor

lukebakken commented Feb 26, 2018

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

@lukebakken lukebakken requested a review from vitaly-krugl Feb 26, 2018

@codecov

This comment has been minimized.

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.

@vitaly-krugl

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

6 checks passed

codecov/patch Coverage not affected when comparing 173ce21...48d8339
Details
codecov/project 82.5% remains the same compared to 173ce21
Details
continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@lukebakken lukebakken deleted the pika-compat-as-module branch Feb 27, 2018

@anton-ryzhov

This comment has been minimized.

Contributor

anton-ryzhov commented Mar 13, 2018

@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

This comment has been minimized.

Member

vitaly-krugl commented Mar 13, 2018

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

This comment has been minimized.

Contributor

anton-ryzhov commented Mar 13, 2018

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

This comment has been minimized.

Contributor

lukebakken commented Mar 13, 2018

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

@vitaly-krugl

This comment has been minimized.

Member

vitaly-krugl commented Mar 13, 2018

Thanks @anton-ryzhov!

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

@lukebakken

This comment has been minimized.

Contributor

lukebakken commented Mar 14, 2018

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

Merge pull request #978 from pika/pika-compat-as-module
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