Re: build package xrayutilities - wheel and pip with setuptools

2022-11-02 Thread PICCA Frederic-Emmanuel
Hello, just for info.

I can confirm that the probleme was in the upstream build system, which was not 
compatible with the setuptools > 60.
After patching the build system, I can confirm that without any change to the 
rules files. It works out of the box.
So there is no issue in pybuild :)), or at least nothing new :)

cheers

Frederic



Re: build package xrayutilities - wheel and pip with setuptools

2022-11-02 Thread Jerome Kieffer
Hi Fred, Hi all other DD,

I am the upstream author of pyFAI and fabio, I wish to thank you for
taking care of the packaging of those software. I am aware there is an
issue with the usage of those software since they use numpy.distutils
(deprecated, to be removed in python3.12 and requires setuptools<60). 
I am working on a different packaging which uses meson-python (same
as scipy>=1.9). The migration of fabio is more-or-less ready
(see this branch: https://github.com/kif/fabio/tree/meson) and I am
just waiting for a new release of meson-python (0.11) to make a new
release (without setup.py). Unlike fabio which is ready for release,
pyFAI will be released either in December or early next year.

On the debian side, I don't know how far is the integration of
meson-python ? https://salsa.debian.org/python-team/packages/meson-python
To me, it is of crucial importance if one wants an updated version of scipy
to be available in debian12. Fabio and pyFAI will follow without
foreseeable issue.

I am interested in the way the man-page should be produced since this
will have to be redone in both those packages. Any advice on this is welcome.

Best regards,
-- 
Jérôme Kieffer
tel +33 476 882 445



Re: build package xrayutilities - wheel and pip with setuptools

2022-11-02 Thread PICCA Frederic-Emmanuel
The upstream was right :), their build system is completly broken with 
setuptools > 60

I need to fix this.

thanks for your help

Fred

Traceback (most recent call last):
  File "/<>/setup.py", line 1137, in 
setup_package()
  File "/<>/setup.py", line 1133, in setup_package
setup(**setup_kwargs)
  File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 87, in 
setup
return distutils.core.setup(**attrs)
  File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 
172, in setup
ok = dist.parse_command_line()
  File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 
474, in parse_command_line
args = self._parse_command_opts(parser, args)
  File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 1107, in 
_parse_command_opts
nargs = _Distribution._parse_command_opts(self, parser, args)
  File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 
540, in _parse_command_opts
raise DistutilsClassError(
distutils.errors.DistutilsClassError: command class  must subclass Command
E: pybuild pybuild:379: clean: plugin distutils failed with: exit code=1: 
python3.10 setup.py clean 
dh_auto_clean: error: pybuild --clean -i python{version} -p 3.10 returned exit 
code 13
make: *** [debian/rules:16: clean] Error 25
dpkg-buildpackage: error: fakeroot debian/rules clean subprocess returned exit 
status 2



- Mail d’origine -
De: PICCA Frederic-Emmanuel 
frederic-emmanuel.pi...@synchrotron-soleil.fr
À: Scott Kitterman deb...@kitterman.com
Cc: debian-python@lists.debian.org
Envoyé: Wed, 02 Nov 2022 09:03:45 +0100 (CET)
Objet: Re: build package xrayutilities - wheel and pip with setuptools

Ok, I understand better what is going on.

in pyproject.toml there is these lines.

[build-system]
requires = [
wheel,
setuptools60.0.0,
oldest-supported-numpy,
scipy,
sphinx,
nbsphinx,
silx=0.10,
Cython=0.25
]

indeed the setuptools  60, can not be fullfill, So I think that this is why 
it try to use pip in order to install the required version of setuptools.

the strack trace seems to config this.


dh clean --buildsystem=pybuild
   dh_auto_clean -O--buildsystem=pybuild
install -d 
/BUILDDIR/pyfai-0.21.3\+dfsg1/debian/.debhelper/generated/_source/home
pybuild --clean -i python{version} -p 3.10
I: pybuild base:240: python3.10 setup.py clean 
/PKGBUILDDIR/setup.py:43: DeprecationWarning: The distutils 
package is deprecated and slated for removal in Python 3.12. Use setuptools or 
check PEP 632 for potential alternatives
  from distutils.command.clean import clean as Clean
/usr/lib/python3/dist-packages/_distutils_hack/__init__.py:18: UserWarning: 
Distutils was imported before Setuptools, but importing Setuptools also 
replaces the `distutils` module in `sys.modules`. This may lead to undesirable 
behaviors or errors. To avoid these issues, avoid using distutils directly, 
ensure that setuptools is installed in the traditional way (e.g. not an 
editable install), and/or make sure that setuptools is always imported before 
distutils.
  warnings.warn(
/usr/lib/python3/dist-packages/_distutils_hack/__init__.py:33: UserWarning: 
Setuptools is replacing distutils.
  warnings.warn(Setuptools is replacing distutils.)
INFO: Disabling color, you really want to install colorlog.
INFO:pythran:Disabling color, you really want to install colorlog.
INFO:pyFAI.setup:Use setuptools with cython
INFO:pyFAI.setup:Use setuptools.setup
/usr/lib/python3/dist-packages/setuptools/installer.py:27: 
SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements 
should be satisfied by a PEP 517 installer.
  warnings.warn(
/usr/lib/python3/dist-packages/setuptools/installer.py:60: UserWarning: Unbuilt 
egg for pyFAI [unknown version] (/PKGBUILDDIR)
  environment = pkg_resources.Environment()
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, 
status=None)) after connection broken by ProxyError(Cannot connect 
to proxy., 
NewConnectionError(pip._vendor.urllib3.connection.HTTPSConnection 
object at 0x7fbbf0c8ae60: Failed to establish a new connection: [Errno 111] 
Connection refused)): /simple/setuptools/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, 
status=None)) after connection broken by ProxyError(Cannot connect 
to proxy., 
NewConnectionError(pip._vendor.urllib3.connection.HTTPSConnection 
object at 0x7fbbf0c8ad40: Failed to establish a new connection: [Errno 111] 
Connection refused)): /simple/setuptools/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, 
status=None)) after connection broken by ProxyError(Cannot connect 
to proxy., 
NewConnectionError(pip._vendor.urllib3.connection.HTTPSConnection 
object at 0x7fbbf0c8baf0: Failed to establish a new connection: [Errno 111] 
Connection refused)): /simple/setuptools/
WARNING: 

Re: build package xrayutilities - wheel and pip with setuptools

2022-11-02 Thread PICCA Frederic-Emmanuel
Ok, I understand better what is going on.

in pyproject.toml there is these lines.

[build-system]
requires = [
"wheel",
"setuptools<60.0.0",
"oldest-supported-numpy",
"scipy",
"sphinx",
"nbsphinx",
"silx>=0.10",
"Cython>=0.25"
]

indeed the setuptools < 60, can not be fullfill, So I think that this is why it 
try to use pip in order to install the required version of setuptools.

the strack trace seems to config this.


dh clean --buildsystem=pybuild
   dh_auto_clean -O--buildsystem=pybuild
install -d 
/<>/pyfai-0.21.3\+dfsg1/debian/.debhelper/generated/_source/home
pybuild --clean -i python{version} -p 3.10
I: pybuild base:240: python3.10 setup.py clean 
/<>/setup.py:43: DeprecationWarning: The distutils package is 
deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 
632 for potential alternatives
  from distutils.command.clean import clean as Clean
/usr/lib/python3/dist-packages/_distutils_hack/__init__.py:18: UserWarning: 
Distutils was imported before Setuptools, but importing Setuptools also 
replaces the `distutils` module in `sys.modules`. This may lead to undesirable 
behaviors or errors. To avoid these issues, avoid using distutils directly, 
ensure that setuptools is installed in the traditional way (e.g. not an 
editable install), and/or make sure that setuptools is always imported before 
distutils.
  warnings.warn(
/usr/lib/python3/dist-packages/_distutils_hack/__init__.py:33: UserWarning: 
Setuptools is replacing distutils.
  warnings.warn("Setuptools is replacing distutils.")
INFO: Disabling color, you really want to install colorlog.
INFO:pythran:Disabling color, you really want to install colorlog.
INFO:pyFAI.setup:Use setuptools with cython
INFO:pyFAI.setup:Use setuptools.setup
/usr/lib/python3/dist-packages/setuptools/installer.py:27: 
SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements 
should be satisfied by a PEP 517 installer.
  warnings.warn(
/usr/lib/python3/dist-packages/setuptools/installer.py:60: UserWarning: Unbuilt 
egg for pyFAI [unknown version] (/<>)
  environment = pkg_resources.Environment()
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, 
status=None)) after connection broken by 'ProxyError('Cannot connect to 
proxy.', NewConnectionError(': Failed to establish a new connection: [Errno 111] 
Connection refused'))': /simple/setuptools/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, 
status=None)) after connection broken by 'ProxyError('Cannot connect to 
proxy.', NewConnectionError(': Failed to establish a new connection: [Errno 111] 
Connection refused'))': /simple/setuptools/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, 
status=None)) after connection broken by 'ProxyError('Cannot connect to 
proxy.', NewConnectionError(': Failed to establish a new connection: [Errno 111] 
Connection refused'))': /simple/setuptools/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, 
status=None)) after connection broken by 'ProxyError('Cannot connect to 
proxy.', NewConnectionError(': Failed to establish a new connection: [Errno 111] 
Connection refused'))': /simple/setuptools/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, 
status=None)) after connection broken by 'ProxyError('Cannot connect to 
proxy.', NewConnectionError(': Failed to establish a new connection: [Errno 111] 
Connection refused'))': /simple/setuptools/
ERROR: Could not find a version that satisfies the requirement 
setuptools<60.0.0 (from versions: none)
ERROR: No matching distribution found for setuptools<60.0.0
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/setuptools/installer.py", line 82, in 
fetch_build_egg
subprocess.check_call(cmd)
  File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/bin/python3.10', '-m', 'pip', 
'--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpmx8yh9o_', 
'--quiet', 'setuptools<60.0.0']' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/<>/setup.py", line 1137, in 
setup_package()
  File "/<>/setup.py", line 1133, in setup_package
setup(**setup_kwargs)
  File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 86, in 
setup
_install_setup_requires(attrs)
  File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 80, in 
_install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
  File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 875, in 
fetch_build_eggs
resolved_dists = pkg_resources.working_set.resolve(
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 789, in 
resolve
dist = best[req.key] = env.best_match(
  File 

Re: build package xrayutilities - wheel and pip with setuptools

2022-11-02 Thread PICCA Frederic-Emmanuel
Hello, I juste added PYBUILD_SYSTEM=distutils

so now pybuild use the setup.py file. (at least this is a workaround :).
now it failes with this error

/usr/bin/python3.10: No module named pip

so I am wondering if pip should not be added to the setuptools dependency ?

I will add mannualy pip in the B-D and see if it works at the end.

Cheers

Fred


dh clean --buildsystem=pybuild
   dh_auto_clean -O--buildsystem=pybuild
install -d 
/<>/pyfai-0.21.3\+dfsg1/debian/.debhelper/generated/_source/home
pybuild --clean -i python{version} -p 3.10
I: pybuild base:240: python3.10 setup.py clean 
/<>/setup.py:43: DeprecationWarning: The distutils package is 
deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 
632 for potential alternatives
  from distutils.command.clean import clean as Clean
/usr/lib/python3/dist-packages/_distutils_hack/__init__.py:18: UserWarning: 
Distutils was imported before Setuptools, but importing Setuptools also 
replaces the `distutils` module in `sys.modules`. This may lead to undesirable 
behaviors or errors. To avoid these issues, avoid using distutils directly, 
ensure that setuptools is installed in the traditional way (e.g. not an 
editable install), and/or make sure that setuptools is always imported before 
distutils.
  warnings.warn(
/usr/lib/python3/dist-packages/_distutils_hack/__init__.py:33: UserWarning: 
Setuptools is replacing distutils.
  warnings.warn("Setuptools is replacing distutils.")
INFO: Disabling color, you really want to install colorlog.
INFO:pythran:Disabling color, you really want to install colorlog.
INFO:pyFAI.setup:Use setuptools with cython
INFO:pyFAI.setup:Use setuptools.setup
/usr/lib/python3/dist-packages/setuptools/installer.py:27: 
SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements 
should be satisfied by a PEP 517 installer.
  warnings.warn(
/usr/lib/python3/dist-packages/setuptools/installer.py:34: UserWarning: Unbuilt 
egg for pyFAI [unknown version] (/<>)
  pkg_resources.get_distribution('wheel')
WARNING: The wheel package is not available.
/usr/lib/python3/dist-packages/setuptools/installer.py:60: UserWarning: Unbuilt 
egg for pyFAI [unknown version] (/<>)
  environment = pkg_resources.Environment()
/usr/bin/python3.10: No module named pip
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/setuptools/installer.py", line 82, in 
fetch_build_egg
subprocess.check_call(cmd)
  File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/bin/python3.10', '-m', 'pip', 
'--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmppdpybvy1', 
'--quiet', 'setuptools<60.0.0']' returned non-zero exit status 1.




- Mail d’origine -
De: Scott Kitterman deb...@kitterman.com
À: debian-python@lists.debian.org
Envoyé: Tue, 01 Nov 2022 20:36:20 +0100 (CET)
Objet: Re: build package xrayutilities - wheel and pip with setuptools

On Tuesday, November 1, 2022 3:31:47 PM EDT PICCA Frederic-Emmanuel wrote:
  I don#039;t think it should do that, so we need to investigate.  
Where
  can I find the updated packaging?
 
 I did not push the change right now, I will push once I solve this issue 
:).
 
 my opinion is that I should force via PYBUILD_SYSTEM=distutils
 
 Fred

If that works, I think its fine, but I dont think it should be 
necessary.  
Let me know once you push the package and Ill see if theres a 
pybuild issue.

Scott K



Re: build package xrayutilities - wheel and pip with setuptools

2022-11-01 Thread PICCA Frederic-Emmanuel
> I dont think it should do that, so we need to investigate.  Where can I 
> find 
> the updated packaging?

I did not push the change right now, I will push once I solve this issue :).

my opinion is that I should force via PYBUILD_SYSTEM=distutils

Fred



Re: build package xrayutilities - wheel and pip with setuptools

2022-11-01 Thread Scott Kitterman
On Tuesday, November 1, 2022 3:31:47 PM EDT PICCA Frederic-Emmanuel wrote:
> > I dont think it should do that, so we need to investigate.  Where
> > can I find the updated packaging?
> 
> I did not push the change right now, I will push once I solve this issue :).
> 
> my opinion is that I should force via PYBUILD_SYSTEM=distutils
> 
> Fred

If that works, I think it's fine, but I don't think it should be necessary.  
Let me know once you push the package and I'll see if there's a pybuild issue.

Scott K

signature.asc
Description: This is a digitally signed message part.


Re: build package xrayutilities - wheel and pip with setuptools

2022-11-01 Thread PICCA Frederic-Emmanuel
>It looks to me like the current pyproject.toml file for pyfai is not 
>sufficient 
> to build the package, so I would tempted to keep what you have now.

Due to the presence of this file, pybuild try to build using the "new way" 
instead of building with setup.py.

I do not know if other package are in this state, but if produce an FTBFS.

Cheers



Re: build package xrayutilities - wheel and pip with setuptools

2022-11-01 Thread Scott Kitterman
On Tuesday, November 1, 2022 3:02:00 PM EDT PICCA Frederic-Emmanuel wrote:
> >It looks to me like the current pyproject.toml file for pyfai is not
> >sufficient>
> > to build the package, so I would tempted to keep what you have now.
> 
> Due to the presence of this file, pybuild try to build using the "new way"
> instead of building with setup.py.
> 
> I do not know if other package are in this state, but if produce an FTBFS.
> 
> Cheers

I don't think it should do that, so we need to investigate.  Where can I find 
the updated packaging?

Scott K

signature.asc
Description: This is a digitally signed message part.


Re: build package xrayutilities - wheel and pip with setuptools

2022-11-01 Thread PICCA Frederic-Emmanuel
> As far as I can see, the package doesnt ship any files in /usr/bin.  
> Why do 
> you need to build man pages (Im assuming thats what thats 
> for?  More 
> generically, what problem did that step in the process solve thats not 
> solved 
> now?

this is for the pyfai package which I need to update

https://salsa.debian.org/science-team/pyfai



Re: build package xrayutilities - wheel and pip with setuptools

2022-11-01 Thread Scott Kitterman
On Tuesday, November 1, 2022 2:48:12 PM EDT Scott Kitterman wrote:
> On Tuesday, November 1, 2022 2:42:22 PM EDT PICCA Frederic-Emmanuel wrote:
> > > As far as I can see, the package doesnt ship any files in
> > > /usr/bin.
> > > Why do you need to build man pages (Im assuming thats what
> > > thats for?  More generically, what problem did that step in the
> > > process solve thats not solved now?
> > 
> > this is for the pyfai package which I need to update
> > 
> > https://salsa.debian.org/science-team/pyfai
> 
> I see.  I was confused by the subject saying this was about xrayutilities
> still.  I'll have a look.
> 
> Scott K

It looks to me like the current pyproject.toml file for pyfai is not sufficient 
to build the package, so I would tempted to keep what you have now.

For another package (weasyprint) where I have to build the man page from 
Sphinx documentation myself, I use this to build it:

override_dh_installman:
PYTHONPATH=.:$PYTHONPATH sphinx-build -b man docs debian
dh_installman

Then weasyprint.manpages has:

debian/weasyprint.1

Their build_man command has a lot of moving parts, so pyfai may br more 
complicated.

AScott K

signature.asc
Description: This is a digitally signed message part.


Re: build package xrayutilities - wheel and pip with setuptools

2022-11-01 Thread Scott Kitterman
On Tuesday, November 1, 2022 2:42:22 PM EDT PICCA Frederic-Emmanuel wrote:
> > As far as I can see, the package doesnt ship any files in /usr/bin. 
> > Why do you need to build man pages (Im assuming thats what
> > thats for?  More generically, what problem did that step in the
> > process solve thats not solved now?
> 
> this is for the pyfai package which I need to update
> 
> https://salsa.debian.org/science-team/pyfai

I see.  I was confused by the subject saying this was about xrayutilities 
still.  I'll have a look.

Scott K


signature.asc
Description: This is a digitally signed message part.


Re: build package xrayutilities - wheel and pip with setuptools

2022-11-01 Thread Scott Kitterman
On Tuesday, November 1, 2022 11:15:59 AM EDT PICCA Frederic-Emmanuel wrote:
> thanks for your help.
> 
> I have one more question
> 
> I have  this command from the previous build
> 
> {interpreter} setup.py build_man
> 
> how can I translate this with the new build systeme ?

As far as I can see, the package doesn't ship any files in /usr/bin.  Why do 
you need to build man pages (I'm assuming that's what that's for?  More 
generically, what problem did that step in the process solve that's not solved 
now?

Scott K

signature.asc
Description: This is a digitally signed message part.


Re: build package xrayutilities - wheel and pip with setuptools

2022-11-01 Thread PICCA Frederic-Emmanuel
thanks for your help.

I have one more question

I have  this command from the previous build

{interpreter} setup.py build_man

how can I translate this with the new build systeme ?



Re: build package xrayutilities - wheel and pip with setuptools

2022-10-31 Thread Scott Kitterman
On Monday, October 31, 2022 1:26:03 PM EDT Carsten Schoenert wrote:
> Hello Frederic,
> 
> Am 31.10.22 um 08:57 schrieb PICCA Frederic-Emmanuel:
> >> I can build the package basically doing these modifications and by
> >> adding the additional B-D package Scott did mention. Simply let
> >> dh_sphinxdoc build the documentation and adding the additional needed
> >> package dependencies.
> > 
> > [your patch]
> > 
> > In your proposition you removed the arch/indep split, is it on purpose ?
> 
> yes, building the Sphinx based documentation doesn't need to be done
> that (to me fragile) way. debhelper is smart enough to do the right
> things in the correct order if you tell it to use the sphinxdoc module.

Agreed.  

More generally, use of setup.py is being deprecated in favor of the 
pyproject.toml based interface with the various Python build systems 
(including setuptools).  The approach Carsten is recommending is recommending 
is not only more robust, it is more future proof.  At some point your upstream 
will probably stop including the setup.py and you don't want to depend on it 
if you don't need to (and you don't).

Scott K


signature.asc
Description: This is a digitally signed message part.


Re: build package xrayutilities - wheel and pip with setuptools

2022-10-31 Thread Carsten Schoenert

Hello Frederic,

Am 31.10.22 um 08:57 schrieb PICCA Frederic-Emmanuel:

I can build the package basically doing these modifications and by
adding the additional B-D package Scott did mention. Simply let
dh_sphinxdoc build the documentation and adding the additional needed
package dependencies.


[your patch]

In your proposition you removed the arch/indep split, is it on purpose ?


yes, building the Sphinx based documentation doesn't need to be done 
that (to me fragile) way. debhelper is smart enough to do the right 
things in the correct order if you tell it to use the sphinxdoc module.


--
Regards
Carsten



Re: build package xrayutilities - wheel and pip with setuptools

2022-10-31 Thread PICCA Frederic-Emmanuel
> Hello Frederic,

Hello Carsten

> please could you provide next time direct links to the VCS/Tracker of 
> your package, that prevents time to search for the correct package on my 
> or others people side. Also a speaking subject content is helping me to 
> decide if I want to spend time on taking a look, youve choose a very 
> generic line. :-)

ack

> https://tracker.debian.org/pkg/xrayutilities
> https://salsa.debian.org/science-team/python-xrayutilities

> No as you have overwritten the default target by a call that is quite 
> similar to the original pybuild call.

> Yes, the environment isnt the same for the second call, youd need 
> to 
> ensure that the build directory is clean before starting the second run. 
> But I dont see why this construct youve build in d/rules is 
> needed 
> that way.

ok

> I can build the package basically doing these modifications and by 
> adding the additional B-D package Scott did mention. Simply let 
> dh_sphinxdoc build the documentation and adding the additional needed 
> package dependencies.

[your patch]

In your proposition you removed the arch/indep split, is it on purpose ?

> lintian has some additional remarks any way, I havent looked further at 
> these.

ok

Cheers

Fred



Re: build package xrayutilities - wheel and pip with setuptools

2022-10-30 Thread Carsten Schoenert

Hello Frederic,

please could you provide next time direct links to the VCS/Tracker of 
your package, that prevents time to search for the correct package on my 
or others people side. Also a speaking subject content is helping me to 
decide if I want to spend time on taking a look, you've choose a very 
generic line. :-)


https://tracker.debian.org/pkg/xrayutilities
https://salsa.debian.org/science-team/python-xrayutilities

Am 30.10.22 um 01:08 schrieb picca:

Le 2022-10-30 00:39, Scott Kitterman a écrit :


Adding  pybuild-plugin-pyproject to build-depends should solve it.  It
looks like it is trying to do the new pyproject.toml style build
without all the necessary parts in place.


the package contain a pyproject.toml file and a setup.py one.

the build system in the pyproject file is setuptools.

[build-system]
requires = ["setuptools", "wheel", "numpy"]
build-backend = "setuptools.build_meta"

So I imagine that under the hood it use the setup.py file.


No as you have overwritten the default target by a call that is quite 
similar to the original pybuild call.



now it fails with this error message

adding 'xrayutilities-1.7.3.dist-info/top_level.txt'
adding 'xrayutilities-1.7.3.dist-info/RECORD'
removing build/bdist.linux-x86_64/wheel
* Building wheel...
Successfully built xrayutilities-1.7.3-cp310-cp310-linux_x86_64.whl
I: pybuild plugin_pyproject:118: Unpacking wheel built for python3.10 with 
"installer" module
E: pybuild pybuild:379: build: plugin pyproject failed with: File already exists: 
/<>/.pybuild/cpython3_3.10_xrayutilities/build/xrayutilities/VERSION
dh_auto_build: error: pybuild --build -i python{version} -p 3.10 returned exit 
code 13
make[1]: *** [debian/rules:20: override_dh_auto_build-arch] Error 25


this failure seems to come from the indep part


%:
  dh $@ --buildsystem=pybuild

execute_after_dh_auto_clean:
  rm -rf build

override_dh_auto_build-arch:
  dh_auto_build

override_dh_auto_build-indep: override_dh_auto_build-arch
ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
  dh_auto_build -- -s custom --build-args="env
PYTHONPATH={build_dir} {interpreter} setup.py build_doc"
endif


since I make the indep part depends on the arch one, it build the
package a second time. and this is during this second reconstruction
that
it failes.

it seems that the arch rules does not gard from a second build, and it
is not indepotent...


Yes, the environment isn't the same for the second call, you'd need to 
ensure that the build directory is clean before starting the second run. 
But I don't see why this construct you've build in d/rules is needed 
that way.


I can build the package basically doing these modifications and by 
adding the additional B-D package Scott did mention. Simply let 
dh_sphinxdoc build the documentation and adding the additional needed 
package dependencies.



$ git diff
diff --git a/debian/control b/debian/control
index 4a702ea..1b746a3 100644
--- a/debian/control
+++ b/debian/control
@@ -10,9 +10,9 @@ Section: science
 Priority: optional
 Build-Depends:
  debhelper-compat (= 13),
- dh-python,
  dh-sequence-numpy3,
  dh-sequence-python3,
+ pybuild-plugin-pyproject,
  python3-all-dev,
  python3-h5py,
  python3-lmfit,
diff --git a/debian/rules b/debian/rules
index 54c4cb0..089385d 100755
--- a/debian/rules
+++ b/debian/rules
@@ -4,6 +4,7 @@
 # Uncomment this to turn on verbose mode.
 export DH_VERBOSE=1
 export DEB_BUILD_MAINT_OPTIONS=hardening=+all
+export DEB_HOST_ARCH?=$(shell dpkg-architecture -qDEB_HOST_ARCH)
 
 # copy the tests to the build dir to be able to pass nose

 export PYBUILD_NAME=xrayutilities
@@ -11,18 +12,13 @@ export PYBUILD_BEFORE_TEST=cp -r tests {build_dir}; cp -r 
examples {build_dir};
 export PYBUILD_AFTER_TEST=rm -rf {build_dir}/tests; rm -rf 
{build_dir}/xrayutilities/materials/data; rm -rf {build_dir}/examples
 
 %:

-   dh $@ --buildsystem=pybuild
+   dh $@ --with sphinxdoc --buildsystem=pybuild
 
-execute_after_dh_auto_clean:

-   rm -rf build
-
-override_dh_auto_build-arch:
-   dh_auto_build
-
-override_dh_auto_build-indep: override_dh_auto_build-arch
+override_dh_sphinxdoc:
 ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
-   dh_auto_build -- -s custom --build-args="env PYTHONPATH={build_dir} 
{interpreter} setup.py build_doc"
+   PYTHONPATH=. python3 -m sphinx -b html -N doc/source 
$(CURDIR)/debian/python-xrayutilities-doc/usr/share/doc/python-xrayutilities-doc/html
+   dh_sphinxdoc
 endif
 
-execute_after_dh_installdocs:

-   dh_installdocs -p python-xrayutilities-doc build/sphinx/html
+execute_after_dh_auto_clean:
+   rm -rf build


lintian has some additional remarks any way, I haven't looked further at 
these.


--
Regards
Carsten



Re: wheel and pip with setuptools

2022-10-29 Thread picca

Le 2022-10-30 00:39, Scott Kitterman a écrit :


Adding  pybuild-plugin-pyproject to build-depends should solve it.  It
looks like it is trying to do the new pyproject.toml style build
without all the necessary parts in place.


the package contain a pyproject.toml file and a setup.py one.

the build system in the pyproject file is setuptools.

[build-system]
requires = ["setuptools", "wheel", "numpy"]
build-backend = "setuptools.build_meta"

So I imagine that under the hood it use the setup.py file.

now it fails with this error message

adding 'xrayutilities-1.7.3.dist-info/top_level.txt'
adding 'xrayutilities-1.7.3.dist-info/RECORD'
removing build/bdist.linux-x86_64/wheel
* Building wheel...
Successfully built xrayutilities-1.7.3-cp310-cp310-linux_x86_64.whl
I: pybuild plugin_pyproject:118: Unpacking wheel built for python3.10 
with "installer" module
E: pybuild pybuild:379: build: plugin pyproject failed with: File 
already exists: 
/<>/.pybuild/cpython3_3.10_xrayutilities/build/xrayutilities/VERSION
dh_auto_build: error: pybuild --build -i python{version} -p 3.10 
returned exit code 13

make[1]: *** [debian/rules:20: override_dh_auto_build-arch] Error 25


this failure seems to come from the indep part


%:
dh $@ --buildsystem=pybuild

execute_after_dh_auto_clean:
rm -rf build

override_dh_auto_build-arch:
dh_auto_build

override_dh_auto_build-indep: override_dh_auto_build-arch
ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
dh_auto_build -- -s custom --build-args="env 
PYTHONPATH={build_dir} {interpreter} setup.py build_doc"

endif


since I make the indep part depends on the arch one, it build the 
package a second time. and this is during this second reconstruction 
that

it failes.

it seems that the arch rules does not gard from a second build, and it 
is not indepotent...



Fred



Re: wheel and pip with setuptools

2022-10-29 Thread Scott Kitterman



On October 29, 2022 10:07:13 PM UTC, picca  wrote:
>Hello, I try to fix an FTBFS in the python-xrayutilities package.
>When I try to build it, I get this error message., I do not understand why I 
>need to add a build dependency to python3-wheel.Is it something missing in the 
>dependency of python3-setuptools or python3.10 ?
>
>thanks for your help
>
>Frederic
>
>
>
>dh clean --buildsystem=pybuild
>dh_auto_clean -O--buildsystem=pybuild
>install -d /<>/debian/.debhelper/generated/_source/home
>pybuild --clean -i python{version} -p 3.10
>I: pybuild base:240: python3.10 setup.py clean
>/usr/lib/python3/dist-packages/setuptools/installer.py:27: 
>SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements 
>should be satisfied by a PEP 517 installer.
>warnings.warn(
>WARNING: The wheel package is not available.
>/usr/bin/python3.10: No module named pip
>Traceback (most recent call last):
>File "/usr/lib/python3/dist-packages/setuptools/installer.py", line 82, in 
>fetch_build_egg
>subprocess.check_call(cmd)
>File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
>raise CalledProcessError(retcode, cmd)
>subprocess.CalledProcessError: Command '['/usr/bin/python3.10', '-m', 'pip', 
>'--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpq9o0m_9e', 
>'--quiet', 'h5py']' returned non-zero exit status 1.The above exception was 
>the direct cause of the following exception:
>


Adding  pybuild-plugin-pyproject to build-depends should solve it.  It looks 
like it is trying to do the new pyproject.toml style build without all the 
necessary parts in place.

Scott K



wheel and pip with setuptools

2022-10-29 Thread picca

Hello, I try to fix an FTBFS in the python-xrayutilities package.
When I try to build it, I get this error message., I do not understand 
why I need to add a build dependency to python3-wheel.Is it something 
missing in the dependency of python3-setuptools or python3.10 ?


thanks for your help

Frederic



dh clean --buildsystem=pybuild
dh_auto_clean -O--buildsystem=pybuild
install -d /<>/debian/.debhelper/generated/_source/home
pybuild --clean -i python{version} -p 3.10
I: pybuild base:240: python3.10 setup.py clean
/usr/lib/python3/dist-packages/setuptools/installer.py:27: 
SetuptoolsDeprecationWarning: setuptools.installer is deprecated. 
Requirements should be satisfied by a PEP 517 installer.

warnings.warn(
WARNING: The wheel package is not available.
/usr/bin/python3.10: No module named pip
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/setuptools/installer.py", line 82, 
in fetch_build_egg

subprocess.check_call(cmd)
File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/bin/python3.10', '-m', 
'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', 
'/tmp/tmpq9o0m_9e', '--quiet', 'h5py']' returned non-zero exit status 
1.The above exception was the direct cause of the following exception: