Skip to content

BUG: setup.py does not allow equal filenames in *different* directories #9415

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 1 commit into from
Feb 11, 2015

Conversation

blbradley
Copy link
Contributor

Is it possible to write tests for setup.py?

Setup

touch pandas/period.pyx

and put this in your setup.py's ext_data:

    period=dict(pyxfile='period'),

Before PR

python setup.py build_ext --inplace
rm -rf pandas/period.c
python setup.py build_ext --inplace
python setup.py clean 
ls -l pandas/period.c
# -rw-rw-r-- 1 brandon brandon 48253 Feb  4 15:27 pandas/period.c

period.c still exists after cleaning.

After PR

python setup.py build_ext --inplace
rm -rf pandas/period.c
python setup.py build_ext --inplace
python setup.py clean
ls -l pandas/period.c   
# ls: cannot access pandas/period.c: No such file or directory

@jreback jreback added the Testing pandas testing functions or related to the test suite label Feb 5, 2015
continue

# XXX
if 'ujson' in f:
Copy link
Contributor

Choose a reason for hiding this comment

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

can't remove ujson from this as these are part of the src/ujson/lib dir.

maybe directly specify ALL of the *.c files by dir and filename (or just dir) for the exclusions

Copy link
Contributor Author

Choose a reason for hiding this comment

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

f is this context is the filename (only). So the ujson conditional doesn't do anything since those filenames are already part of the list.

I thought about that but didn't want to break the way it worked before. So you are saying that all excluded files should be referred to by their project root relative path? e.g. src/ujson/lib/ultrajsondec.c. I believe directories should be allowed for exclusion also.

Edited: directory example

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The ujson conditional also does nothing because none of the filenames in src/ujson/lib have ujson in them.

@jreback jreback added the Build Library building on various platforms label Feb 5, 2015
@jreback
Copy link
Contributor

jreback commented Feb 5, 2015

you could write tests for setup.py in that you could assert existance of certain files known to be there. It would guard against a file being removed that is known (e.g. period.c which should be there), but, if a new file were added then it couldn't assert for that (e.g. say you added a module which add foo.c), so would be a bit tricky to keep the tests in sync.

So kind of +/- 0 on this.

@blbradley
Copy link
Contributor Author

@jreback gotcha. thanks for the input on testing.

'pandas/src/parser/tokenizer.c',
'pandas/src/parser/io.c',
'pandas/src/ujson/python/ujson.c',
'pandas/src/ujson/python/objToJSON.c',
Copy link
Contributor

Choose a reason for hiding this comment

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

this is much more explicit which is good

@blbradley blbradley force-pushed the clean-exclude-path-check branch from e23c586 to 8805910 Compare February 10, 2015 20:55
jreback added a commit that referenced this pull request Feb 11, 2015
BUG: setup.py does not allow equal filenames in *different* directories
@jreback jreback merged commit bb9c311 into pandas-dev:master Feb 11, 2015
@jreback
Copy link
Contributor

jreback commented Feb 11, 2015

@blbradley thanks for this

@blbradley blbradley deleted the clean-exclude-path-check branch February 11, 2015 14:43
@blbradley
Copy link
Contributor Author

@jreback That was the easy one. 😏

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 Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants