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

[debian] please use setuptools requires in order to provide the build dependencies #207

Closed
picca opened this issue Apr 16, 2018 · 14 comments · Fixed by #217
Closed

[debian] please use setuptools requires in order to provide the build dependencies #207

picca opened this issue Apr 16, 2018 · 14 comments · Fixed by #217

Comments

@picca
Copy link

picca commented Apr 16, 2018

Hello,

In order to build pymca and run the tests during the build, I needed to add all these dependencies.
It is possible to automatically generate the Debian binary dependency from the setup.py (like for pyFAI or silx). It would be great if you could provide this for pymca.

Then I could maintain a patch on top of this for Debian, in order to deal with the pyqt5 (dependency).
I am not sure thaht pyqt5 provide eggs infor for this purpose.

I got these informations looking at the autodoc sphinx part during the build.

Cheers

                python-fisx-dbg <!nocheck>,
+               python-h5py <!nocheck> <!nodoc>,
+               python-h5py-dbg <!nocheck> <!nodoc>,
+               python-ipython,
+               python-matplotlib <!nodoc>,
+               python-matplotlib-dbg <!nodoc>,
                python-numpy,
                python-numpy-dbg,
+               python-opengl,
+               python-pyqt5 <!nodoc>,
+               python-pyqt5-dbg <!nodoc>,
+               python-pyqt5.qtopengl <!nodoc>,
+               python-pyqt5.qtopengl-dbg <!nodoc>,
+               python-pyqtgraph,
+               python-qtconsole,
                python-setuptools,
                python-sphinx,
                python-typing,
                python3-all-dbg,
                python3-all-dev,
                python3-fisx <!nocheck>,
                python3-fisx-dbg <!nocheck>,
+               python3-h5py <!nocheck> <!nodoc>,
+               python3-h5py-dbg <!nocheck> <!nodoc>,
+               python3-ipython,
+               python3-matplotlib <!nodoc>,
+               python3-matplotlib-dbg <!nodoc>,
                python3-numpy,
                python3-numpy-dbg,
+               python3-opengl,
+               python3-pyqt5 <!nodoc>,
+               python3-pyqt5-dbg <!nodoc>,
+               python3-pyqt5.qtopengl <!nodoc>,
+               python3-pyqt5.qtopengl-dbg <!nodoc>,
+               python3-pyqtgraph,
+               python3-qtconsole,
                python3-setuptools,
                python3-sphinx
@vasole
Copy link
Owner

vasole commented Apr 20, 2018

Wow, a lot of things there are either one or the other. For instance, qtconsole replaces ipython, pyqtgraph is certainly not needed.

Have you taken a look at our build scripts for Debian? They are supplied with the project:

https://github.com/vasole/pymca/blob/master/build-deb.sh

What is needed to make them OK?

BTW. Issue #212 is a no-go. I have to produce a v5.3.1 as soon as possible and it would be desirable to include in it as many of your requirements as possible. @PiRK is already working on the documentation issues.

@vasole
Copy link
Owner

vasole commented Apr 24, 2018

The setup.py provides minimalist install_requires and setup_requires and the same is made by silx.

I guess what you are referring to is about providing a requirements.txt file listing all the possible dependencies.

@vasole
Copy link
Owner

vasole commented Apr 24, 2018

#217 should close this issue.

@picca
Copy link
Author

picca commented Apr 28, 2018

Hello, I think that the setup.py file need to be updated.

please read this in order to understand the differencebetween requirements.txt and setup.py

https://caremad.io/posts/2013/07/setup-vs-requirement/

@picca
Copy link
Author

picca commented Apr 28, 2018

I can not reopen the issue myself,could you repoen it.

thanks

@vasole vasole reopened this Apr 28, 2018
@vasole
Copy link
Owner

vasole commented Apr 28, 2018

Issue re-opened although I do not see what is wrong with our setup.py

In order to build PyMca one just needs numpy and that is covered in setup.py under setup_requires.
If you wan to run the tests, then you need also fisx to be installed.

I thing you are mixing what is needed for PyMca with what is needed for Debian due to Debian choices (no generated code, no libqhull or OpenGL headers from third party,...)

To generate the Debian packages we just run the build_deb.sh script distributed with the sources:

https://github.com/vasole/pymca/blob/master/build-deb.sh

Does running that script work for you? We are ready to help on maintaining the official Debian builds but setup.py seems correct to me in terms of build dependencies.

It would be much simpler for you to look at what is specifically needed for Debian under the packages directory because it is what we use to generate the packages at the ESRF:

https://github.com/vasole/pymca/blob/master/package/debian8/control
https://github.com/vasole/pymca/blob/master/package/debian9/control

It would be even better that the code we use for building the ESRF Debian packages and the code you use would be the same code so that we could just provide you with everything so that you just need to validate it.

@picca
Copy link
Author

picca commented Apr 28, 2018

Hello Armando

I added this using your requirements.txt to the setup.py, I do not speak about build dependency but install dependencies :). In fact I need the instal dependencies during the build process in order to run the unit tests.

-install_requires = ["numpy", "matplotlib", "fisx>=1.1.4"]
+install_requires = ["numpy", "matplotlib", "fisx>=1.1.4",
+                    # Added by Debian
+                    "PyOpenGL",
+                    "h5py",
+                    "matplotlib>1.0",
+                    "qtconsole",
+                    "PyQt5",
+                    "silx>=0.7"]

We are working with the ALBA guyes, in order to connect the upstream git repository of taurus and the packaging. We are using the https://dep.debian.net/deps/dep14 for this purpose.
This is quite different from your packages directory organisation.

We have setup an experimental repository for taurus here:

https://salsa.debian.org/cpascual-guest/taurus

I hope that we will converge to something usable by ALBA and Debian.

I am not using the build-dep.sh script because the debian-science team mandate that we use gbp-buildpackage in order to build the packages. It is not manageable to have different way to generate packages. And also we require that the packaging repo are hosted on the Debian infrastructure.

If you want, we can decide that you provide the packages via mentors.debian.net for debian unstable and the backports, I do the review and then we can converge to something which is acceptable for your and me :).

This way I can build it from your source package, but in that case I need to remove the package from the debian-sience team.

May we can try this with one package for now and select pymca for this test

@vasole
Copy link
Owner

vasole commented Apr 28, 2018

So, you have followed the same approach as followed for silx: use the information from requirements.txt to complete the one from setup.py I thought that was what you wanted when opening the issue and because of that I closed the issue with #217.

Certainly I prefer PyMca to be inside debian-science.
What do we need to use the same build chain as debian science?

@vasole
Copy link
Owner

vasole commented Apr 28, 2018

Would your current patching problem be solved by modifying the class sdist_debian(sdist) inside setup.py in such a way that modifies install_requires?

@picca
Copy link
Author

picca commented Apr 28, 2018

Sorry If I was not clear enought.
In fact I try to be as close as possible of generating automatically the dependencies for the packaging.
I think that at the end the packaging should be automatise as much aspossible. The best would be a simple git tag and the Debianpackage should be generated.

It hink that Debian will move slowly to this sort of packaging. The first step is to generate as much of the dependencies from the upstream informations, one branch perde distribution. And a connectionbetween the pstream sources and the packaging.

This is why dep14 is important.
I usemore and more dgit with the dgit-maint-merge wayinorderto do my uploads.

So for now I think that I need to have more experience with the taurus package in order to share this with you and the ESRF. At some point we will converge to something efficient for both party. (ALBA + Debian).

In order o keep with debian-science,Ijust need a repository when I can do a checkout and directly a
gbp-buildpackage. so I need a debian/sid branch with the correct debian directory in it.
a debian/strech branche etc... :).

I prefer to keep asimplepatch on top of your packaging and not addmorelogic in the setup.py file.
I think that setup.py should be completly descriptive instread of a mix of code and data.

Cheers

@vasole
Copy link
Owner

vasole commented Apr 28, 2018

h5py is going to be a hard dependency, so that one is not going to be a problem.

If I have properly understood, at this point for you the simplest thing is that I conditionally add the GUI dependencies based in an environmental variable. Something like WITH_GUI set to 1 or --with-gui passed in the command line in the same way it is done to deal with cython.

@picca
Copy link
Author

picca commented Apr 28, 2018

I think that you must add all the dependencies which allows to have what you considere a working pymca. Then if you have optional dependencies, I do not know how to express this with setuptools.

BUT I can add them via a Debian specific patch or you can indeed provide a sort of WITH_OPTIONAL_DEPENDENCIES. I like also this option because I can rely on you for the optional dependencies.

Cheers

@vasole
Copy link
Owner

vasole commented Apr 28, 2018

Please take a look at #231 to see if that is simpler for you.

  • WITH_GUI from the environment set to anything not in ["False", "0", 0]
  • passing --gui to the setup.py

WITH_OPTIONAL_DEPENDENCIES would trigger other things not available under debian

@vasole
Copy link
Owner

vasole commented Jun 5, 2018

@picca

Can this be closed? I would like to be sure there are no changes requested once 5.3.2 is released.

@vasole vasole closed this as completed Jul 11, 2018
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 a pull request may close this issue.

2 participants