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

Adds a basic MANIFEST.in file #2077

Merged
merged 1 commit into from
Nov 2, 2017
Merged

Conversation

jakirkham
Copy link
Contributor

@jakirkham jakirkham commented Nov 2, 2017

Fixes #1791

Make sure to include the README, LICENSE, and CHANGELOG. Also make sure to package the tests. Further ensure the docs and examples are included as well. This is useful for deploying sdists and other products and ensuring they are feature complete.

@@ -0,0 +1,10 @@
include README.rst
include LICENSE.txt
include CHANGELOG.md
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Make sure the license file is definitely included. Include the README and CHANGELOG as well for good measure.

MANIFEST.in Outdated

recursive-include tests *
recursive-exclude * __pycache__
recursive-exclude * *.py[co]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ensure end users can run the tests.

MANIFEST.in Outdated
recursive-exclude * *.py[co]

recursive-include docs Makefile make.bat *.conf *.css *.html *.ico *.ipynb *.js *.json *.npy *.png *.py *.rst *.svg
recursive-include examples *.csv *.gz *.ipynb *.md *.npz *.png
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Basically searched and included all extensions from the docs and the examples. Not sure if we want all of them or even if we want the docs and examples packaged. Feel free to let me know either way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also as there are some data files listed here, it is good to be careful with packaging these in case they are big. Am happy to keep or remove these as deemed appropriate.

Copy link
Member

Choose a reason for hiding this comment

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

We've deliberately kept the size of these small, so this should be fine.

Copy link
Contributor

Choose a reason for hiding this comment

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

As long as the stuff in the doc submodules isn't pulled in, everything should be fine (i.e the reference/test data)/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So the only submodules I see are doc/builder and doc/nbpublisher. Are we trying to exclude those?

Also I see doc/test_data/ as an ordinary directory. Should that be removed?

Copy link
Contributor

Choose a reason for hiding this comment

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

So the only submodules I see are doc/builder and doc/nbpublisher. Are we trying to exclude those?

Yes please.

Also I see doc/test_data/ as an ordinary directory. Should that be removed?

It should also be excluded. It probably doesn't have to exist (i.e could be created dynamically) but it is used - when you run notebook tests locally it fills up.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Have added lines to prune the two submodules. These seem to work as intended.

Was unclear on doc/test_data. Should we keep it just in case something uses it and forgets to create it or is that a non-issue?

Copy link
Contributor

Choose a reason for hiding this comment

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

The presence of the directory doesn't really matter, as you say, it might be prudent to keep it. The important thing is that nothing from inside that directory should be included.

@jlstevens
Copy link
Contributor

jlstevens commented Nov 2, 2017

Thanks for doing this!

Could you test one thing for me though. After building with sdist, could you try installing it in a clean environment and see if holoviews --install-examples works? It may well complain about needing nbconvert/nbformat (easily pip/conda installed) but that command should create a directory full of the example notebooks if the sdist archive contains all the notebooks correctly...

@jakirkham
Copy link
Contributor Author

jakirkham commented Nov 2, 2017

Seem to be running into a little snafu.

$ python setup.py sdist
Traceback (most recent call last):
  File "setup.py", line 164, in <module>
    holoviews.__version__.verify(setup_args['version'])
  File "/zopt/conda2/envs/test/lib/python3.6/site-packages/param/version.py", line 286, in verify
    raise Exception("Supplied string version does not match current version.")
Exception: Supplied string version does not match current version

Is there something else I need to be doing here?

Edit: Maybe I need to add a tag locally to fix this?

@jlstevens
Copy link
Contributor

This is a check we use when making PyPI releases to make sure the version as set with git tag matches the string version supplied in setup.py. We don't use PyPI for dev releases which is why this check is in place.

@jlstevens
Copy link
Contributor

jlstevens commented Nov 2, 2017

There is a PR in param that introduces a mechanism to disable this check for non-PyPI release uses of sdist (which we aren't currently using). For now, I would recommend you just comment out this line while testing.

@jakirkham
Copy link
Contributor Author

I think I got around it. I made a commit bumping the version in setup.py and holoviews/__init__.py then tagged with the same version. Seems to have built an sdist. Will try testing now.

@jlstevens
Copy link
Contributor

I think I got around it. I made a commit bumping the version in setup.py and holoviews/init.py then tagged with the same version. Seems to have built an sdist. Will try testing now.

That's the right thing to do! 👍

@jakirkham
Copy link
Contributor Author

Cool. Used pip to install it into an environment where all dependencies were already satisfied for simplicity. Seems holoviews --install-examples added a holoviews-examples in my cwd. Guessing that is what is expected. Anything I should look for in it?

@jlstevens
Copy link
Contributor

Is it full of notebooks? If so that is success! Otherwise this PR hasn't fixed an issue I was hoping it would fix - which isn't to say this PR shouldn't be merged.

@jakirkham
Copy link
Contributor Author

Yep. Just as an example...

$ ls holoviews-examples/gallery/demos/matplotlib/
area_chart.ipynb                  histogram_example.ipynb           measles_example.ipynb             stocks_example.ipynb
autompg_histogram.ipynb           iris_density_grid.ipynb           network_graph.ipynb               surface_3d.ipynb
bachelors_degrees_by_gender.ipynb iris_example.ipynb                polar_scatter_demo.ipynb          texas_choropleth_example.ipynb
bars_economic.ipynb               iris_splom_example.ipynb          quiver_demo.ipynb                 topographic_hillshading.ipynb
boxplot_chart.ipynb               legend_example.ipynb              scatter_economic.ipynb            trisurf3d_demo.ipynb
dragon_curve.ipynb                lorenz_attractor_example.ipynb    square_limit.ipynb                us_unemployment.ipynb
dropdown_economic.ipynb           mandelbrot_section.ipynb          step_chart.ipynb                  verhulst_mandelbrot.ipynb

@jlstevens
Copy link
Contributor

Fantastic!

You've solved a packaging issue that was giving me a headache. I'm happy to see this PR merged when the tests pass - I'll let @philippjfr do the final review/merge.

@jlstevens
Copy link
Contributor

In particular this would solve #1791. I'll checkout this branch and try it out myself to double check!

MANIFEST.in Outdated
recursive-include doc Makefile make.bat *.conf *.css *.html *.ico *.ipynb *.js *.json *.npy *.png *.py *.rst *.svg
prune doc/builder
prune doc/nbpublisher
recursive-exclude doc/test_data *
Copy link
Contributor Author

Choose a reason for hiding this comment

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

So I couldn't figure out how to keep this directory empty. Seems it needs at least one file to stick around. Seems to only have a README in it in master. Maybe we can exclude all data or just include the README?

Currently the code here deletes that directory entirely.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that is fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry I couldn't help myself. Kept playing with it locally. Now it just keeps the README. Can revert back to this change if you prefer though.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also good 👍

Copy link
Member

Choose a reason for hiding this comment

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

I don't think that's an issue. The user can't run the tests that would use this directory without the submodules anyway and we'll soon be replacing this machinery entirely.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alright feel free to override whatever sits on this line. I have no strong opinions. 😄

Make sure to include the README, LICENSE, and CHANGELOG. Also make sure
to package the tests. Further ensure the docs and examples are included
as well. This is useful for deploying sdists and other products and
ensuring they are feature complete.
@jlstevens
Copy link
Contributor

Anyway, I just double checked for myself and I think #1791 is fixed!

I'm always suspicious of packaging but I really hope the the following command mirrors what would happen if you installed from PyPI:

pip install ./dist/holoviews-1.9.0.tar.gz

Unfortunately, I find packaging issues often turns out to be black magic where even simple assumptions like this don't hold the way you would like...

@jakirkham
Copy link
Contributor Author

Yep, that should be a good test. My experiences with MANIFEST.in have generally been pretty solid. Though I know what you mean about needing tricks for building sometimes. 😉

Took the liberty of adding the fixes line in the OP. Please let me know if there is anything else. 😄

@jlstevens
Copy link
Contributor

Please let me know if there is anything else. 😄

Nope. Thanks again for this, it is really helpful!

I'm happy to merge when the tests pass. Do you agree @philippjfr ?

@philippjfr
Copy link
Member

Absolutely, thanks so much for solving this headache for us!

@philippjfr
Copy link
Member

Tests passed so I'll go ahead and merge. Thanks again!

@philippjfr philippjfr merged commit 7b36632 into holoviz:master Nov 2, 2017
@jakirkham jakirkham deleted the add_manifest branch November 2, 2017 23:49
@jakirkham
Copy link
Contributor Author

Absolutely! Glad to help.

This should hopefully also make PyPI sdists a viable source in the conda-forge recipe, which should make packaging on that front a little easier. Should that be a direction that you would be willing to consider.

Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants