Skip to content

Fix the non cython build for cpp extensions #19707

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

Merged
merged 7 commits into from
Feb 19, 2018

Conversation

hexgnu
Copy link
Contributor

@hexgnu hexgnu commented Feb 15, 2018

cc @TomAugspurger @jreback

This should fix the problem with building with a non Cython environment. The problem is that we assume extensions are C everywhere and I didn't realize that this was a test path.

Also setup.py might be in need of a rethink, there's a lot of special conditions that I think could be cleaned up with some better formatting.

@pep8speaks
Copy link

pep8speaks commented Feb 15, 2018

Hello @hexgnu! Thanks for updating the PR.

Cheers ! There are no PEP8 issues in this Pull Request. 🍻

Comment last updated on February 19, 2018 at 23:38 Hours UTC

setup.py Outdated
sourcefile = pyxfile[:-3] + extension
msg = ("{extension}-source file '{source}' not found.\n"
"Run 'setup.py cython' before sdist.".format(
source=cfile, extension=extension))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is a mistake fixing now

@codecov
Copy link

codecov bot commented Feb 15, 2018

Codecov Report

Merging #19707 into master will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #19707      +/-   ##
==========================================
+ Coverage    91.6%    91.6%   +<.01%     
==========================================
  Files         150      150              
  Lines       48864    48862       -2     
==========================================
- Hits        44763    44762       -1     
+ Misses       4101     4100       -1
Flag Coverage Δ
#multiple 89.98% <ø> (ø) ⬆️
#single 41.75% <ø> (-0.03%) ⬇️
Impacted Files Coverage Δ
pandas/core/frame.py 97.16% <0%> (-0.07%) ⬇️
pandas/core/indexes/category.py 97.27% <0%> (-0.04%) ⬇️
pandas/core/arrays/categorical.py 94.89% <0%> (-0.02%) ⬇️
pandas/plotting/_converter.py 66.95% <0%> (ø) ⬆️
pandas/core/indexes/base.py 96.45% <0%> (ø) ⬆️
pandas/core/series.py 94.56% <0%> (+0.09%) ⬆️
pandas/core/ops.py 96.83% <0%> (+0.21%) ⬆️

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 21dbe7a...42a80c3. Read the comment docs.

@TomAugspurger
Copy link
Contributor

@chris-b1 do you have any experience with Cython and cpp? Does this look OK to you?

@TomAugspurger
Copy link
Contributor

The pip build stuff looks OK here: https://travis-ci.org/pandas-dev/pandas/jobs/341700234#L2422

@@ -618,7 +622,8 @@ def pxd(name):
'_libs.window': {
'pyxfile': '_libs/window',
'pxdfiles': ['_libs/skiplist', '_libs/src/util'],
'language': 'c++'},
'language': 'c++',
'suffix': '.cpp'},
Copy link
Contributor

Choose a reason for hiding this comment

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

rather than adding 'suffix' any reason not to base the suffix on language='c++'?

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 guess I just saw it as more of a configuration piece that belonged in a dictionary over branches in the code.

I could do something like:

    if suffix == '.pyx':
        source_suffix = '.pyx'
    elif data.get('language', 'c') == 'c++':
        source_suffix = '.cpp'
    else:
        source_suffix = '.c'

But that feels a bit verbose. Thoughts?

Copy link
Contributor

@chris-b1 chris-b1 Feb 15, 2018

Choose a reason for hiding this comment

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

Not a huge deal, but that feels cleaner to me. Reading the config I would probably guess 'suffix' controls the suffix of the output of cython, which it woudln't.

@chris-b1
Copy link
Contributor

One question, but this looks good to me. @hexgnu, certainly welcome any refactoring of setup.py, @jbrockmendel has also been doing some work in that direction, see for instance #19484

@gfyoung gfyoung added Build Library building on various platforms CI Continuous Integration labels Feb 15, 2018
@TomAugspurger
Copy link
Contributor

This seems OK. Any objections @jreback? It'd be good to get that build going on Travis again.

@TomAugspurger TomAugspurger added this to the 0.23.0 milestone Feb 16, 2018
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

looks ok. do you want to try to fix the msgpack c++ stuff while you are at it? IOW fold it into the same framework

@@ -331,19 +330,24 @@ class CheckSDist(sdist_class):
'pandas/_libs/writers.pyx',
'pandas/io/sas/sas.pyx']

_cpp_pyxfiles = ['pandas/_libs/window.pyx']

def initialize_options(self):
sdist_class.initialize_options(self)

def run(self):
if 'cython' in cmdclass:
self.run_command('cython')
else:
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add some comments on what is going on here

@hexgnu
Copy link
Contributor Author

hexgnu commented Feb 17, 2018

K I moved msgpack building into the same loop and added a comment.

@jreback jreback merged commit e022d9a into pandas-dev:master Feb 19, 2018
@jreback
Copy link
Contributor

jreback commented Feb 19, 2018

thanks. hopefully this fixes the pip build.

harisbal pushed a commit to harisbal/pandas that referenced this pull request Feb 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Library building on various platforms CI Continuous Integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pip build test CI failures
6 participants