Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.python > #8415 > unrolled thread

python-mkdocs new dependancy

Started byBrian May <brian@linuxpenguins.xyz>
First post2016-04-12 02:20 +0200
Last post2016-05-11 03:40 +0200
Articles 13 — 4 participants

Back to article view | Back to linux.debian.maint.python


Contents

  python-mkdocs new dependancy Brian May <brian@linuxpenguins.xyz> - 2016-04-12 02:20 +0200
    Re: python-mkdocs new dependancy Piotr Ożarowski <piotr@debian.org> - 2016-04-12 10:50 +0200
      Re: python-mkdocs new dependancy Brian May <bam@debian.org> - 2016-04-18 03:30 +0200
        Re: python-mkdocs new dependancy Piotr Ożarowski <piotr@debian.org> - 2016-04-18 10:30 +0200
        Re: python-mkdocs new dependancy Piotr Ożarowski <piotr@debian.org> - 2016-04-18 10:40 +0200
          Re: python-mkdocs new dependancy Brian May <bam@debian.org> - 2016-04-23 10:20 +0200
            Re: python-mkdocs new dependancy Dmitry Shachnev <mitya57@debian.org> - 2016-04-24 15:00 +0200
              Re: python-mkdocs new dependancy Brian May <bam@debian.org> - 2016-05-02 08:50 +0200
                Re: python-mkdocs new dependancy Piotr Ożarowski <piotr@debian.org> - 2016-05-05 12:20 +0200
                  Re: python-mkdocs new dependancy Brian May <bam@debian.org> - 2016-05-05 12:50 +0200
                    Re: python-mkdocs new dependancy Brian May <bam@debian.org> - 2016-05-10 01:30 +0200
                      Re: python-mkdocs new dependancy Piotr Ożarowski <piotr@debian.org> - 2016-05-10 12:20 +0200
                        Re: python-mkdocs new dependancy Brian May <bam@debian.org> - 2016-05-11 03:40 +0200

#8415 — python-mkdocs new dependancy

FromBrian May <brian@linuxpenguins.xyz>
Date2016-04-12 02:20 +0200
Subjectpython-mkdocs new dependancy
Message-ID<rmUdI-6ik-3@gated-at.bofh.it>
Hello,

When building python-mkdocs from git source I get this error:

LANG=C.UTF-8 PYTHONPATH=. ./debian/scripts/mkdocs build
Traceback (most recent call last):
  File "./debian/scripts/mkdocs", line 7, in <module>
    from mkdocs.__main__ import cli
  File "/<<PKGBUILDDIR>>/mkdocs/__main__.py", line 77, in <module>
    theme_choices = utils.get_theme_names()
  File "/<<PKGBUILDDIR>>/mkdocs/utils/__init__.py", line 382, in get_theme_names
    return get_themes().keys()
  File "/<<PKGBUILDDIR>>/mkdocs/utils/__init__.py", line 374, in get_themes
    for name, theme in themes.items())
  File "/<<PKGBUILDDIR>>/mkdocs/utils/__init__.py", line 374, in <genexpr>
    for name, theme in themes.items())
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2201, in load
    self.require(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2218, in require
    items = working_set.resolve(reqs, env, installer)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 830, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'mkdocs-bootswatch>=0.1.0' distribution was not found and is required by the application
debian/rules:12: recipe for target 'override_dh_auto_build' failed

The python-mkdocs-bootswatch package is distributed as a python module
but doesn't contain python code. It appears to contain HTML and CSS
themes for mkdocs.

What is the appropriate fix? Should I create a new mkdocs-bootswatch
package? Or should I try to somehow incooporate it into the
python-mkdocs package (not sure pybuild/git-dpm supports this?)

I think the package is only useful for mkdocs.

I am somewhat uneasy creating a python3-mkdocs-bootswatch and a
python-mkdocs-bootswatch wouldn't even get used.

Any ideas how to resolve this?
-- 
Brian May <brian@linuxpenguins.xyz>
https://linuxpenguins.xyz/brian/

[toc] | [next] | [standalone]


#8420

FromPiotr Ożarowski <piotr@debian.org>
Date2016-04-12 10:50 +0200
Message-ID<rn2bf-49J-1@gated-at.bofh.it>
In reply to#8415
[Brian May, 2016-04-12]
> When building python-mkdocs from git source I get this error:
> 
> LANG=C.UTF-8 PYTHONPATH=. ./debian/scripts/mkdocs build
> Traceback (most recent call last):
>   File "./debian/scripts/mkdocs", line 7, in <module>
>     from mkdocs.__main__ import cli
>   File "/<<PKGBUILDDIR>>/mkdocs/__main__.py", line 77, in <module>
>     theme_choices = utils.get_theme_names()

I suggest to patch this one to search for themes in /usr/share/mkdocs/
(I just reported a bug asking to move files there)

>   File "/<<PKGBUILDDIR>>/mkdocs/utils/__init__.py", line 382, in get_theme_names
>     return get_themes().keys()
>   File "/<<PKGBUILDDIR>>/mkdocs/utils/__init__.py", line 374, in get_themes
>     for name, theme in themes.items())
>   File "/<<PKGBUILDDIR>>/mkdocs/utils/__init__.py", line 374, in <genexpr>
>     for name, theme in themes.items())
>   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2201, in load
>     self.require(*args, **kwargs)
>   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2218, in require
>     items = working_set.resolve(reqs, env, installer)
>   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 830, in resolve
>     raise DistributionNotFound(req, requirers)
> pkg_resources.DistributionNotFound: The 'mkdocs-bootswatch>=0.1.0' distribution was not found and is required by the application
> debian/rules:12: recipe for target 'override_dh_auto_build' failed
> 
> The python-mkdocs-bootswatch package is distributed as a python module
> but doesn't contain python code. It appears to contain HTML and CSS
> themes for mkdocs.
> 
> What is the appropriate fix? Should I create a new mkdocs-bootswatch

I moved all themes to /usr/share in python-pastescript and it works

> package? Or should I try to somehow incooporate it into the
> python-mkdocs package (not sure pybuild/git-dpm supports this?)

dpkg-source supports this (multiple tarballs) and so does pybuild
(multiple calls with different --dir) but I suggest to simply patch
utils.get_theme_names and move .png/.js/... out of dist-packages
-- 
Piotr Ożarowski                         Debian GNU/Linux Developer
www.ozarowski.pl          www.griffith.cc           www.debian.org
GPG Fingerprint: 1D2F A898 58DA AF62 1786 2DF7 AEF6 F1A2 A745 7645

[toc] | [prev] | [next] | [standalone]


#8437

FromBrian May <bam@debian.org>
Date2016-04-18 03:30 +0200
Message-ID<rp6aK-5eY-3@gated-at.bofh.it>
In reply to#8420
Piotr Ożarowski <piotr@debian.org> writes:

>> What is the appropriate fix? Should I create a new mkdocs-bootswatch
>
> I moved all themes to /usr/share in python-pastescript and it works

Sorry, I don't quite understand. How will this help with the fact that
mkdocs-bootswatch is listed as a requirement, but we don't have
mkdocs-bootswatch in Debian?

Just noticed, that same problem exists for mkdocs-bootstrap too.
-- 
Brian May <bam@debian.org>

[toc] | [prev] | [next] | [standalone]


#8438

FromPiotr Ożarowski <piotr@debian.org>
Date2016-04-18 10:30 +0200
Message-ID<rpcJc-2fT-19@gated-at.bofh.it>
In reply to#8437
[Brian May, 2016-04-18]
> >> What is the appropriate fix? Should I create a new mkdocs-bootswatch
> >
> > I moved all themes to /usr/share in python-pastescript and it works
> 
> Sorry, I don't quite understand. How will this help with the fact that
> mkdocs-bootswatch is listed as a requirement, but we don't have
> mkdocs-bootswatch in Debian?
> 
> Just noticed, that same problem exists for mkdocs-bootstrap too.

if you move themes to /usr/share/mkdocs/themes and patch /usr/bin/mkdocs
to add this dir to sys.path (and there's no other entry point),
even those themes that use pkg_requires will continue to work
-- 
Piotr Ożarowski                         Debian GNU/Linux Developer
www.ozarowski.pl          www.griffith.cc           www.debian.org
GPG Fingerprint: 1D2F A898 58DA AF62 1786 2DF7 AEF6 F1A2 A745 7645

[toc] | [prev] | [next] | [standalone]


#8439

FromPiotr Ożarowski <piotr@debian.org>
Date2016-04-18 10:40 +0200
Message-ID<rpcSR-2jV-13@gated-at.bofh.it>
In reply to#8437
[Brian May, 2016-04-18]
> Sorry, I don't quite understand. How will this help with the fact that
> mkdocs-bootswatch is listed as a requirement, but we don't have
> mkdocs-bootswatch in Debian?

FTR: using not packaged version of mkdocs-bootswatch is not an option,
but that's obvious, right?

[toc] | [prev] | [next] | [standalone]


#8466

FromBrian May <bam@debian.org>
Date2016-04-23 10:20 +0200
Message-ID<rr0Xg-8tB-9@gated-at.bofh.it>
In reply to#8439
Piotr Ożarowski <piotr@debian.org> writes:

> [Brian May, 2016-04-18]
>> Sorry, I don't quite understand. How will this help with the fact that
>> mkdocs-bootswatch is listed as a requirement, but we don't have
>> mkdocs-bootswatch in Debian?
>
> FTR: using not packaged version of mkdocs-bootswatch is not an option,
> but that's obvious, right?

Sorry, still not clear what you intend me to do.

I notice that the three packages have different release cycles.

mkdocs 0.15.1
mkdocs-bootswatch 0.1.0
mkdocs-bootstrap 0.1.1

So I think it is probably a good idea to have three seperate Debian
source packages and three seperate binary packages.

It looks like both mkdocs-bootswatch and mkdocs-bootstrap contain
non-Python code.

So instead of installing these using pybuild/setup.py I could install
them in /usr/share/mkdocs/themes/mkdocs-bootswatch and
/usr/share/mkdocs/themes/mkdocs-bootstrap instead.

Then I need to patch mkdocs to look for files in this directory instead
of using Python's setuptools mechanism.

Does this match what you are thinking?
-- 
Brian May <bam@debian.org>

[toc] | [prev] | [next] | [standalone]


#8468

FromDmitry Shachnev <mitya57@debian.org>
Date2016-04-24 15:00 +0200
Message-ID<rrrNM-4B5-3@gated-at.bofh.it>
In reply to#8466

[Multipart message — attachments visible in raw view] — view raw

Hi Brian,

On Sat, Apr 23, 2016 at 06:16:19PM +1000, Brian May wrote:
> So I think it is probably a good idea to have three seperate Debian
> source packages and three seperate binary packages.
>
> It looks like both mkdocs-bootswatch and mkdocs-bootstrap contain
> non-Python code.
>
> So instead of installing these using pybuild/setup.py I could install
> them in /usr/share/mkdocs/themes/mkdocs-bootswatch and
> /usr/share/mkdocs/themes/mkdocs-bootstrap instead.
>
> Then I need to patch mkdocs to look for files in this directory instead
> of using Python's setuptools mechanism.
>
> Does this match what you are thinking?

Your plan LGTM, though I would still use setup.py to install the themes
(with passing appropriate --install-lib), to make sure that the egg-info
directory (with entry points declarations) is still installed.

And then patch mkdocs to add /usr/share/mkdocs/themes to sys.path like
Piotr suggested.

--
Dmitry Shachnev

[toc] | [prev] | [next] | [standalone]


#8486

FromBrian May <bam@debian.org>
Date2016-05-02 08:50 +0200
Message-ID<rufQ5-70k-7@gated-at.bofh.it>
In reply to#8468
Dmitry Shachnev <mitya57@debian.org> writes:

> Your plan LGTM, though I would still use setup.py to install the themes
> (with passing appropriate --install-lib), to make sure that the egg-info
> directory (with entry points declarations) is still installed.
>
> And then patch mkdocs to add /usr/share/mkdocs/themes to sys.path like
> Piotr suggested.

I have a test version of the packages available:

https://linuxpenguins.xyz/debian/pool/main/m/mkdocs-bootstrap/
https://linuxpenguins.xyz/debian/pool/main/m/mkdocs-bootswatch/
https://linuxpenguins.xyz/debian/pool/main/p/python-mkdocs/

Just noticed I should have referenced #820783 in the changelog for
python-mkdocs.

I haven't yet created git repositories for mkdocs-* in collab-maint -
just trying to work out how to do this. Or do I just type "git init
--bare" and fix the permissions manually?
-- 
Brian May <bam@debian.org>

[toc] | [prev] | [next] | [standalone]


#8492

FromPiotr Ożarowski <piotr@debian.org>
Date2016-05-05 12:20 +0200
Message-ID<rvoxX-6w5-1@gated-at.bofh.it>
In reply to#8486
[Brian May, 2016-05-02]
> Dmitry Shachnev <mitya57@debian.org> writes:
> 
> > Your plan LGTM, though I would still use setup.py to install the themes
> > (with passing appropriate --install-lib), to make sure that the egg-info
> > directory (with entry points declarations) is still installed.
> >
> > And then patch mkdocs to add /usr/share/mkdocs/themes to sys.path like
> > Piotr suggested.
> 
> I have a test version of the packages available:
> 
> https://linuxpenguins.xyz/debian/pool/main/m/mkdocs-bootstrap/

* please use --install-lib instead of moving files after dh_python3.
  Moving files once dh_python{2,3} creates hooks to bytecompile py files
  is not really a good idea.

  export PYBUILD_INSTALL_ARGS=--install-lib=/usr/share/mkdocs/themes/

* PYBUILD_NAME doesn't really make sense if you don't have python- or
  python3- binary packages
* s/Suggests: mkdocs/Enhances: mkdocs/
* s/Description: B/Description: b/
-- 
Piotr Ożarowski                         Debian GNU/Linux Developer
www.ozarowski.pl          www.griffith.cc           www.debian.org
GPG Fingerprint: 1D2F A898 58DA AF62 1786 2DF7 AEF6 F1A2 A745 7645

[toc] | [prev] | [next] | [standalone]


#8493

FromBrian May <bam@debian.org>
Date2016-05-05 12:50 +0200
Message-ID<rvp10-6Mk-5@gated-at.bofh.it>
In reply to#8492
Piotr Ożarowski <piotr@debian.org> writes:

> * please use --install-lib instead of moving files after dh_python3.
>   Moving files once dh_python{2,3} creates hooks to bytecompile py files
>   is not really a good idea.
>
>   export PYBUILD_INSTALL_ARGS=--install-lib=/usr/share/mkdocs/themes/

Was hoping to avoid the need to add /usr/share/mkdocs/themes to the
sys.path.

However, this in hindsight probably would result in a much simpler patch
to mkdocs; and as a result a much better solution.


> * PYBUILD_NAME doesn't really make sense if you don't have python- or
>   python3- binary packages
> * s/Suggests: mkdocs/Enhances: mkdocs/
> * s/Description: B/Description: b/

Thanks for the suggestions.

At the moment the theme packages are stuck in NEW, however if the
packages get approved I will make these changes before uploading mkdocs.
-- 
Brian May <bam@debian.org>

[toc] | [prev] | [next] | [standalone]


#8504

FromBrian May <bam@debian.org>
Date2016-05-10 01:30 +0200
Message-ID<rx2MF-7fB-5@gated-at.bofh.it>
In reply to#8493
Brian May <bam@debian.org> writes:

>>   export PYBUILD_INSTALL_ARGS=--install-lib=/usr/share/mkdocs/themes/
>
> Was hoping to avoid the need to add /usr/share/mkdocs/themes to the
> sys.path.

This results in the following lintian warning:

E: mkdocs-bootstrap: package-installs-python-pycache-dir usr/share/mkdocs/themes/mkdocs_bootstrap/__pycache__/

I think yes we do need this because of __init__.py even though it is 0
bytes. mkdocs uses __init__.py to find the location of the directory.

Should I ignore/override this lintian error?
-- 
Brian May <bam@debian.org>

[toc] | [prev] | [next] | [standalone]


#8505

FromPiotr Ożarowski <piotr@debian.org>
Date2016-05-10 12:20 +0200
Message-ID<rxcVI-yd-7@gated-at.bofh.it>
In reply to#8504
[Brian May, 2016-05-10]
> Brian May <bam@debian.org> writes:
> 
> >>   export PYBUILD_INSTALL_ARGS=--install-lib=/usr/share/mkdocs/themes/
> >
> > Was hoping to avoid the need to add /usr/share/mkdocs/themes to the
> > sys.path.
> 
> This results in the following lintian warning:
> 
> E: mkdocs-bootstrap: package-installs-python-pycache-dir usr/share/mkdocs/themes/mkdocs_bootstrap/__pycache__/

dh_python* is checking usr/share/mkdocs-bootstrap by default (among
other dirs). If you want it to check usr/share/mkdocs as well, you have
to point it to, f.e. like this:

override_dh_python3:
	dh_python3 -N mkdocs-bootstrap
	dh_python3 -p mkdocs-bootstrap /usr/share/mkdocs/themes/

-- 
Piotr Ożarowski                         Debian GNU/Linux Developer
www.ozarowski.pl          www.griffith.cc           www.debian.org
GPG Fingerprint: 1D2F A898 58DA AF62 1786 2DF7 AEF6 F1A2 A745 7645

[toc] | [prev] | [next] | [standalone]


#8511

FromBrian May <bam@debian.org>
Date2016-05-11 03:40 +0200
Message-ID<rxri2-6li-17@gated-at.bofh.it>
In reply to#8505
Piotr Ożarowski <piotr@debian.org> writes:

> dh_python* is checking usr/share/mkdocs-bootstrap by default (among
> other dirs). If you want it to check usr/share/mkdocs as well, you have
> to point it to, f.e. like this:
>
> override_dh_python3:
> 	dh_python3 -N mkdocs-bootstrap
> 	dh_python3 -p mkdocs-bootstrap /usr/share/mkdocs/themes/

Ok, done. Thanks for your help.
-- 
Brian May <bam@debian.org>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.maint.python


csiph-web