Packaging python-xrayutilities

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

Packaging python-xrayutilities

MARIE Alexandre
Hello,

I'm sorry if this is in the wrong place.
I've already asked for help but I had not explained well how I was encountering my problem and couldn't answer before today.
So here it is, i'm trying to update the debian package of python-xrayutilities.

The problem is when I run:    ```gbp import-orig --uscan --pristine-tar```

I get this error :
__________________________________________________________________________________________________________________________________________________________
uscan warn: In directory ., downloading
  https://qa.debian.org/watch/sf.php/xrayutilities/xrayutilities-testdata-20171020.tar.gz failed: 500 SSL upgrade failed: SSL wants a read first
uscan warn: No upstream tarball downloaded. No further processing with mk_origtargz ...
gbp:error: Uscan failed: In directory ., downloading
  https://qa.debian.org/watch/sf.php/xrayutilities/xrayutilities-testdata-20171020.tar.gz failed: 500 SSL upgrade failed: SSL wants a read first</warnings>
<warnings>No upstream tarball downloaded. No further processing with mk_origtargz ...
__________________________________________________________________________________________________________________________________________________________

So what I've done is update d/watch from :

```version=3 opts=uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha)\d*)$/$1~$2/ \ http://sf.net/xrayutilities/xrayutilities-(.+)\.tar\.gz```

to :

```version=4
opts="uversionmangle=s/-pre/~pre/, \
      filenamemangle=s%(?:.*)xrayutilities-(.+)\.tar\.gz/download%\
                      xrayutilities-$1.tar.gz%" \
      http://sourceforge.net/projects/xrayutilities/files/v([\d\.]+)/ \
      (?:.*)xrayutilities-([\d\.]+)\.tar\.gz/download debian uupdate
```

that I got in the uscan man.

Thus I can run again : ```gbp import-orig --uscan --pristine-tar```

And then the command is able to find the right version.

The fact is when I choose the latest version to update debian's one, I get this error :
___________________________________________________________________________________________________________
What is the upstream version? [1.5.1] 1.5.1
gbp:info: Importing '../python-xrayutilities_1.5.1.orig.tar.gz' to branch 'upstream'...
gbp:info: Source package is python-xrayutilities
gbp:info: Upstream version is 1.5.1
Branch pristine-tar set up to track remote branch pristine-tar from origin.
gbp:info: Merging to 'master'
gbp:error: Automatic merge failed.
gbp:error: Error detected, Will roll back changes.
gbp:info: Rolling back branch upstream by resetting it to 5ce1c0bf0d95a9ffd7321a5065041596f05a8fe0
gbp:info: Rolling back branch pristine-tar by deleting it
gbp:info: Rolling back tag upstream/1.5.1 by deleting it
gbp:info: Rolling back branch master by resetting it to 121347cb1309a8ce3821ed3efdd3646442e59ca3
gbp:info: Rolling back failed merge of upstream/1.5.1
gbp:error: Rolled back changes after import error.
___________________________________________________________________________________________________________

Here is where I am stuck and where I am asking for some help please !

Thanks in advance for a response.

Cheers,

Alexandre Marie
Reply | Threaded
Open this post in threaded view
|

Re: Packaging python-xrayutilities

Florian Pelgrim-2
Hi there,

I'm not really deep into packaging but it sounds like the build process
is looking for https links on the uscan target.

Try to replace all http links to https in your package.

Cheers
Flo

Am 18.03.19 um 10:36 schrieb MARIE Alexandre:

> Hello,
>
> I'm sorry if this is in the wrong place.
> I've already asked for help but I had not explained well how I was encountering my problem and couldn't answer before today.
> So here it is, i'm trying to update the debian package of python-xrayutilities.
>
> The problem is when I run:    ```gbp import-orig --uscan --pristine-tar```
>
> I get this error :
> __________________________________________________________________________________________________________________________________________________________
> uscan warn: In directory ., downloading
>    https://qa.debian.org/watch/sf.php/xrayutilities/xrayutilities-testdata-20171020.tar.gz failed: 500 SSL upgrade failed: SSL wants a read first
> uscan warn: No upstream tarball downloaded. No further processing with mk_origtargz ...
> gbp:error: Uscan failed: In directory ., downloading
>    https://qa.debian.org/watch/sf.php/xrayutilities/xrayutilities-testdata-20171020.tar.gz failed: 500 SSL upgrade failed: SSL wants a read first</warnings>
> <warnings>No upstream tarball downloaded. No further processing with mk_origtargz ...
> __________________________________________________________________________________________________________________________________________________________
>
> So what I've done is update d/watch from :
>
> ```version=3 opts=uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha)\d*)$/$1~$2/ \ http://sf.net/xrayutilities/xrayutilities-(.+)\.tar\.gz```
>
> to :
>
> ```version=4
> opts="uversionmangle=s/-pre/~pre/, \
>        filenamemangle=s%(?:.*)xrayutilities-(.+)\.tar\.gz/download%\
>                        xrayutilities-$1.tar.gz%" \
>        http://sourceforge.net/projects/xrayutilities/files/v([\d\.]+)/ \
>        (?:.*)xrayutilities-([\d\.]+)\.tar\.gz/download debian uupdate
> ```
>
> that I got in the uscan man.
>
> Thus I can run again : ```gbp import-orig --uscan --pristine-tar```
>
> And then the command is able to find the right version.
>
> The fact is when I choose the latest version to update debian's one, I get this error :
> ___________________________________________________________________________________________________________
> What is the upstream version? [1.5.1] 1.5.1
> gbp:info: Importing '../python-xrayutilities_1.5.1.orig.tar.gz' to branch 'upstream'...
> gbp:info: Source package is python-xrayutilities
> gbp:info: Upstream version is 1.5.1
> Branch pristine-tar set up to track remote branch pristine-tar from origin.
> gbp:info: Merging to 'master'
> gbp:error: Automatic merge failed.
> gbp:error: Error detected, Will roll back changes.
> gbp:info: Rolling back branch upstream by resetting it to 5ce1c0bf0d95a9ffd7321a5065041596f05a8fe0
> gbp:info: Rolling back branch pristine-tar by deleting it
> gbp:info: Rolling back tag upstream/1.5.1 by deleting it
> gbp:info: Rolling back branch master by resetting it to 121347cb1309a8ce3821ed3efdd3646442e59ca3
> gbp:info: Rolling back failed merge of upstream/1.5.1
> gbp:error: Rolled back changes after import error.
> ___________________________________________________________________________________________________________
>
> Here is where I am stuck and where I am asking for some help please !
>
> Thanks in advance for a response.
>
> Cheers,
>
> Alexandre Marie
>

Reply | Threaded
Open this post in threaded view
|

RE:Packaging python-xrayutilities

MARIE Alexandre

Thanks again for the response !

I am resending an answer as the first one was sent to Florian Pelgrim only.

> Try to replace all http links to https in your package.
Changing http to https didn't solve the issue.

I still get this error :
__________________________________________________________________________________________________________________________________________________________
What is the upstream version? [1.5.1]
gbp:info: Importing '../python-xrayutilities_1.5.1.orig.tar.gz' to branch 'upstream'...
gbp:info: Source package is python-xrayutilities
gbp:info: Upstream version is 1.5.1
Branch pristine-tar set up to track remote branch pristine-tar from origin.
gbp:info: Merging to 'master'
gbp:error: Automatic merge failed.
gbp:error: Error detected, Will roll back changes.
gbp:info: Rolling back branch upstream by resetting it to a6a78543327c683bda62802445a37132d18af730
gbp:info: Rolling back branch pristine-tar by deleting it
gbp:info: Rolling back tag upstream/1.5.1 by deleting it
gbp:info: Rolling back branch master by resetting it to c64c56e88836df1e54a8cd1926dfd621c3161254
gbp:info: Rolling back failed merge of upstream/1.5.1
gbp:error: Rolled back changes after import error.
__________________________________________________________________________________________________________________________________________________________

Thanks for your time.

Cheers,

Alex
Reply | Threaded
Open this post in threaded view
|

Re: Packaging python-xrayutilities

Andrey Rahmatullin-3
On Mon, Mar 18, 2019 at 03:20:24PM +0000, MARIE Alexandre wrote:
> gbp:error: Automatic merge failed.
You need to find why there are conflicts and fix them. Good first steps
are running gbp with --no-rollback and/or finding what upstream files are
modified in the master branch in the current state.

--
WBR, wRAR

signature.asc (911 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

RE:Packaging python-xrayutilities

MARIE Alexandre
>  You need to find why there are conflicts and fix them. Good first steps
>  are running gbp with --no-rollback and/or finding what upstream files are
>  modified in the master branch in the current state.

When I do so, I only have one conflict on the file .gitignore.
I solved it and tried to commit all the staged changes in git gui, I get this message :

```commit-tree failed: fatal: 5d93...... is not a valid 'commit object'```

This error prevents me from doing anything more.

Thanks in advance for response.

Cheers,

Alex
Reply | Threaded
Open this post in threaded view
|

RE:Packaging python-xrayutilities

MARIE Alexandre
Hello,

I resolved my git issue, but when I build the package doc with sphinx-build :

```
make[1]: Entering directory '/<<PKGBUILDDIR>>'
pybuild --build -s custom -p 3.7 --build-args="env PYTHONPATH={build_dir} sphinx-build -bhtml doc/source build/sphinx/html"
I: pybuild base:217: env PYTHONPATH=/<<PKGBUILDDIR>>/.pybuild/cpython3_3.7_xrayutilities/build sphinx-build -bhtml doc/source build/sphinx/html
```

I get this error :

```
/<<PKGBUILDDIR>>/doc/source/examples.rst:7: WARNING: Duplicate explicit target name: "here".
WARNING: autodoc: failed to import module 'xrayutilities'; the following exception was raised:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/sphinx/ext/autodoc/importer.py", line 154, in import_module
    __import__(modname)
  File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.7_xrayutilities/build/xrayutilities/__init__.py", line 74, in <module>
    __version__ = pkg_resources.get_distribution("xrayutilities").version
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 481, in get_distribution
    dist = get_provider(dist)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 357, in get_provider
    return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 900, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 786, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'xrayutilities' distribution was not found and is required by the application
```

Does someone know how to deal with this kind of issue ?

Thanks in advance. Cheers,

Alex
Reply | Threaded
Open this post in threaded view
|

RE:Packaging python-xrayutilities

MARIE Alexandre
Hello,

I'm still working on the package python-xrayutilities for debian.

I've come to a point where the package can be built but when generating the doc,
lintian comes with a bunch of privacy-generic-breach tags like this :
____________________________________________________________________________________________________________________________________________________________________
W: python-xrayutilities-doc: privacy-breach-generic usr/share/doc/python-xrayutilities/html/_modules/index.html [<script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=tex-ams-mml_htmlormml">] (https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=tex-ams-mml_htmlormml)
____________________________________________________________________________________________________________________________________________________________________


I have tried to add in debian/rules this :
___________________________________________________________________________________________________________________________
override_dh_installdocs:
        ln -s /usr/share/javascript/mathjax/MathJax.js $(CURDIR)/doc/build/html/_static/MathJax.js
        find doc/build/html -name "*.html" -exec sed -i "s|https://cdn.mathjax.org/mathjax/latest/MathJax.js|_static/MathJax.js|" {} \;
    dh_installdocs -ppython-xrayutilities-doc doc/build/html
___________________________________________________________________________________________________________________________


But it does not seem to work.

Cheers,

Alex

Reply | Threaded
Open this post in threaded view
|

Re: Packaging python-xrayutilities

Andrey Rahmatullin-3
On Thu, Mar 21, 2019 at 10:09:22AM +0000, MARIE Alexandre wrote:
> override_dh_installdocs:
>         ln -s /usr/share/javascript/mathjax/MathJax.js $(CURDIR)/doc/build/html/_static/MathJax.js
> find doc/build/html -name "*.html" -exec sed -i "s|https://cdn.mathjax.org/mathjax/latest/MathJax.js|_static/MathJax.js|" {} \;
>     dh_installdocs -ppython-xrayutilities-doc doc/build/html
Is there really the leading tab only on the second line?

> But it does not seem to work.
What exactly doesn't seem to work?

--
WBR, wRAR

signature.asc (911 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Packaging python-xrayutilities

Andreas Tille-5
On Thu, Mar 21, 2019 at 03:23:52PM +0500, Andrey Rahmatullin wrote:
> On Thu, Mar 21, 2019 at 10:09:22AM +0000, MARIE Alexandre wrote:
> > override_dh_installdocs:
> >         ln -s /usr/share/javascript/mathjax/MathJax.js $(CURDIR)/doc/build/html/_static/MathJax.js
> > find doc/build/html -name "*.html" -exec sed -i "s|https://cdn.mathjax.org/mathjax/latest/MathJax.js|_static/MathJax.js|" {} \;
> >     dh_installdocs -ppython-xrayutilities-doc doc/build/html
> Is there really the leading tab only on the second line?
>
> > But it does not seem to work.
> What exactly doesn't seem to work?

Wild guessing: The files to be changed might reside in debian/tmp - thus


    find debian ...

could be the solution.

Kind regards

     Andreas.

--
http://fam-tille.de

Reply | Threaded
Open this post in threaded view
|

RE:Packaging python-xrayutilities

MARIE Alexandre
In reply to this post by Andrey Rahmatullin-3
> Is there really the leading tab only on the second line?

In fact I am trying to figure out where should I install the doc, and how could I avoid the lintian tag : privacy-breach-generic.

> What exactly doesn't seem to work?

The code I paste before wasn't working because the path was not good, I should have cleaned that before, sorry.

First I have this overrided to use the right method :
_____________________________________________________________
override_dh_installdocs-indep:
        PYTONPATH=$(CURDIR)/debian python3 setup.py build_doc
        dh_installdocs
_____________________________________________________________

Then I want to deal with mathjax causing the privacy-breach-generic.
But I really don't know how to do that.

Cheers,

Alex


Reply | Threaded
Open this post in threaded view
|

RE:Packaging python-xrayutilities

MARIE Alexandre
In reply to this post by Andreas Tille-5
> Wild guessing: The files to be changed might reside in debian/tmp - thus
>
>
>     find debian ...
>
> could be the solution.

I am trying to do so, thanks for your response.

Cheers,

Alex

Reply | Threaded
Open this post in threaded view
|

Re: Packaging python-xrayutilities

Alex Mestiashvili-4
In reply to this post by MARIE Alexandre
On 3/21/19 11:44 AM, MARIE Alexandre wrote:

>> Is there really the leading tab only on the second line?
>
> In fact I am trying to figure out where should I install the doc, and how could I avoid the lintian tag : privacy-breach-generic.
>
>> What exactly doesn't seem to work?
>
> The code I paste before wasn't working because the path was not good, I should have cleaned that before, sorry.
>
> First I have this overrided to use the right method :
> _____________________________________________________________
> override_dh_installdocs-indep:
> PYTONPATH=$(CURDIR)/debian python3 setup.py build_doc
> dh_installdocs
> _____________________________________________________________
>
> Then I want to deal with mathjax causing the privacy-breach-generic.
> But I really don't know how to do that.
>
> Cheers,
>
> Alex
>
>

Hi,

I didn't have time to look into issue, but may be looking on how other
people solve similar problems will give you a hint:

 https://codesearch.debian.net/search?q=path%3Adebian%2Frules+mathjax

Best,
Alex

Reply | Threaded
Open this post in threaded view
|

RE:Packaging python-xrayutilities

MARIE Alexandre
> Hi,
>
> I didn't have time to look into issue, but may be looking on how other
> people solve similar problems will give you a hint:
>
>  https://codesearch.debian.net/search?q=path%3Adebian%2Frules+mathjax
>
> Best,
> Alex

Hello,
Thanks for the hint,
this is where I am looking to deal with the issue,
but there are things that I don't understand,
thus I'm asking it here.

Cheers,

Alex

Reply | Threaded
Open this post in threaded view
|

Re: Packaging python-xrayutilities

Dmitry Shachnev-3
In reply to this post by MARIE Alexandre
Hi Marie!

On Thu, Mar 21, 2019 at 10:09:22AM +0000, MARIE Alexandre wrote:

> Hello,
>
> I'm still working on the package python-xrayutilities for debian.
>
> I've come to a point where the package can be built but when generating the doc,
> lintian comes with a bunch of privacy-generic-breach tags like this :
>
> W: python-xrayutilities-doc: privacy-breach-generic [...]
> (https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=tex-ams-mml_htmlormml)
>
> I have tried to add in debian/rules this :
> override_dh_installdocs:
>         ln -s /usr/share/javascript/mathjax/MathJax.js $(CURDIR)/doc/build/html/_static/MathJax.js
>         find doc/build/html -name "*.html" -exec sed -i "s|https://cdn.mathjax.org/mathjax/latest/MathJax.js|_static/MathJax.js|" {} \;
>         dh_installdocs -ppython-xrayutilities-doc doc/build/html
>
> But it does not seem to work.
Don’t do anything in debian/rules. Instead, patch your conf.py to
have a line like this:

  mathjax_path = 'file:///usr/share/javascript/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML'

This way the files produced by Sphinx will have the right path, and there
won’t be any need for making symlinks.

--
Dmitry Shachnev
(maintainer of both sphinx and mathjax packages)

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Packaging python-xrayutilities

Dmitry Shachnev-3
On Thu, Mar 21, 2019 at 02:36:01PM +0300, Dmitry Shachnev wrote:
> Hi Marie!

Perhaps this should have been ‘Hi Alexandre’. Sorry if I got this wrong.

--
Dmitry Shachnev

signature.asc (849 bytes) Download Attachment