Re: failing to package attrs-strict for swh.model

2020-06-25 Thread zimoun
On Thu, 25 Jun 2020 at 16:42, Marius Bakke  wrote:

> Does it make a difference if you remove python-typing?  That
> functionality was merged into Python 3.5, perhaps it expects an older
> version of 'collections.abc'.

Yes, now it seems ok.  Well, "Ran 0 tests" is weird... another story I
guess. :-)

--8<---cut here---start->8---
starting phase `check'
running "python setup.py" with command "test" and parameters ()
running test
running egg_info
writing src/attrs_strict.egg-info/PKG-INFO
writing dependency_links to src/attrs_strict.egg-info/dependency_links.txt
writing requirements to src/attrs_strict.egg-info/requires.txt
writing top-level names to src/attrs_strict.egg-info/top_level.txt
reading manifest file 'src/attrs_strict.egg-info/SOURCES.txt'
writing manifest file 'src/attrs_strict.egg-info/SOURCES.txt'
running build_ext

--
Ran 0 tests in 0.000s

OK
phase `check' succeeded after 0.5 seconds
--8<---cut here---end--->8---

Thank you for the help.

Cheers,
simon



Re: failing to package attrs-strict for swh.model

2020-06-25 Thread Marius Bakke
zimoun  writes:

>> Can you paste the full package definition?
>
> Well, I have tried with and without the 'arguments'.
>
> --8<---cut here---start->8---
> (define-public python-attrs-strict
>   (package
> (name "python-attrs-strict")
> (version "0.1.0")
> (source
>   (origin
> (method url-fetch)
> (uri (pypi-uri "attrs_strict" version))
> (sha256
>   (base32
> "0nldyv053xiv9aaysjszgisi9d9d87f5l2jf3rhl3xm9c9spar96"
> (build-system python-build-system)
> (native-inputs
>  `(("python-pytest" ,python-pytest)
>("python-pluggy" ,python-pluggy)))
> (propagated-inputs
>   `(("python-attrs" ,python-attrs)
> ("python-typing" ,python-typing)))

Does it make a difference if you remove python-typing?  That
functionality was merged into Python 3.5, perhaps it expects an older
version of 'collections.abc'.


signature.asc
Description: PGP signature


Re: failing to package attrs-strict for swh.model

2020-06-25 Thread zimoun
Hi Efraim,

On Thu, 25 Jun 2020 at 16:04, Efraim Flashner  wrote:

>> Well, what I want at the end is the PyPI package "swh.model".
>
> I believe according to the python output from previous building packages
> abc_registry has been deprecated since 3.3. I would just skip the tests
> for now and see if upstream has an answer for building with python-3.8.

Disabling the tests fixes the issue. :-)

The same happens when building 'swh.model':

--8<---cut here---start->8---
self._abc_registry = extra._abc_registry
AttributeError: type object 'Callable' has no attribute '_abc_registry'
--8<---cut here---end--->8---

Well, if all the tests are disable then something seems wrong. :-)


Cheers,
simon



Re: failing to package attrs-strict for swh.model

2020-06-25 Thread Efraim Flashner
On Thu, Jun 25, 2020 at 02:59:53PM +0200, zimoun wrote:
> Hi Marius,
> 
> Thank you for the help.
> 
> On Wed, 24 Jun 2020 at 22:10, Marius Bakke  wrote:
> 
> > I notice the file name in this command is "attrs_strict".  Probably the
> > importer picked the wrong file name and you need to change it to
> > (pypi-uri "attrs_strict" version).
> 
> Thanks!  Stupid mistake I did. :-)
> 
> > Can you paste the full package definition?
> 
> Well, I have tried with and without the 'arguments'.
> 
> --8<---cut here---start->8---
> (define-public python-attrs-strict
>   (package
> (name "python-attrs-strict")
> (version "0.1.0")
> (source
>   (origin
> (method url-fetch)
> (uri (pypi-uri "attrs_strict" version))
> (sha256
>   (base32
> "0nldyv053xiv9aaysjszgisi9d9d87f5l2jf3rhl3xm9c9spar96"
> (build-system python-build-system)
> (native-inputs
>  `(("python-pytest" ,python-pytest)
>("python-pluggy" ,python-pluggy)))
> (propagated-inputs
>   `(("python-attrs" ,python-attrs)
> ("python-typing" ,python-typing)))
> (arguments
>  `(#:phases (modify-phases %standard-phases
>   (replace 'check
> (lambda _
>   (invoke "pytest")
>   #t)
> (home-page "https://github.com/bloomberg/attrs-strict;)
> (synopsis "Runtime validators for attrs")
> (description
>  "Package that contains runtime validation for @code{attrs} data classes
> based on the types existing in the typing module.")
> (license license:asl2.0)))
> --8<---cut here---end--->8---
> 
> Then the Traceback is:
> 
> --8<---cut here---start->8---
> starting phase `check'
> Traceback (most recent call last):
>   File 
> "/gnu/store/3bk454z353a42l1l4yaxa6lrl3dh24mv-python-pytest-5.3.5/bin/.pytest-real",
>  line 11, in 
> load_entry_point('pytest==5.3.5', 'console_scripts', 'pytest')()
>   File 
> "/gnu/store/q9rm8h9imazsq2c4qiv2yjpvlvliywqb-python-3.8.2/lib/python3.8/site-packages/pkg_resources/__init__.py",
>  line 489, in load_entry_point
> return get_distribution(dist).load_entry_point(group, name)
>   File 
> "/gnu/store/q9rm8h9imazsq2c4qiv2yjpvlvliywqb-python-3.8.2/lib/python3.8/site-packages/pkg_resources/__init__.py",
>  line 2852, in load_entry_point
> return ep.load()
>   File 
> "/gnu/store/q9rm8h9imazsq2c4qiv2yjpvlvliywqb-python-3.8.2/lib/python3.8/site-packages/pkg_resources/__init__.py",
>  line 2443, in load
> return self.resolve()
>   File 
> "/gnu/store/q9rm8h9imazsq2c4qiv2yjpvlvliywqb-python-3.8.2/lib/python3.8/site-packages/pkg_resources/__init__.py",
>  line 2449, in resolve
> module = __import__(self.module_name, fromlist=['__name__'], level=0)
>   File 
> "/gnu/store/3bk454z353a42l1l4yaxa6lrl3dh24mv-python-pytest-5.3.5/lib/python3.8/site-packages/pytest/__init__.py",
>  line 6, in 
> from _pytest.assertion import register_assert_rewrite
>   File 
> "/gnu/store/3bk454z353a42l1l4yaxa6lrl3dh24mv-python-pytest-5.3.5/lib/python3.8/site-packages/_pytest/assertion/__init__.py",
>  line 5, in 
> from typing import Optional
>   File 
> "/gnu/store/lnbh9ks047sw41b6dc3zk6z1qy4b8cv0-python-typing-3.7.4.1/lib/python3.8/site-packages/typing.py",
>  line 1357, in 
> class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
>   File 
> "/gnu/store/lnbh9ks047sw41b6dc3zk6z1qy4b8cv0-python-typing-3.7.4.1/lib/python3.8/site-packages/typing.py",
>  line 1005, in __new__
> self._abc_registry = extra._abc_registry
> AttributeError: type object 'Callable' has no attribute '_abc_registry'
> command "pytest" failed with status 1
> --8<---cut here---end--->8---
> 
> And without the 'replace' i.e., "python setup.py test", the Traceback
> is:
> 
> --8<---cut here---start->8---
> starting phase `check'
> running "python setup.py" with command "test" and parameters ()
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "setup.py", line 14, in 
> setup(long_description=long_description)
>   File 
> "/gnu/store/q9rm8h9imazsq2c4qiv2yjpvlvliywqb-python-3.8.2/lib/python3.8/site-packages/setuptools/__init__.py",
>  line 145, in setup
> return distutils.core.setup(**attrs)
>   File 
> "/gnu/store/q9rm8h9imazsq2c4qiv2yjpvlvliywqb-python-3.8.2/lib/python3.8/distutils/core.py",
>  line 134, in setup
> [...]
> import typing
>   File 
> "/gnu/store/lnbh9ks047sw41b6dc3zk6z1qy4b8cv0-python-typing-3.7.4.1/lib/python3.8/site-packages/typing.py",
>  line 1357, in 
> class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
>   File 
> "/gnu/store/lnbh9ks047sw41b6dc3zk6z1qy4b8cv0-python-typing-3.7.4.1/lib/python3.8/site-packages/typing.py",
>  line 1005, in __new__
> self._abc_registry = extra._abc_registry
> 

Re: failing to package attrs-strict for swh.model

2020-06-25 Thread zimoun
Hi Marius,

Thank you for the help.

On Wed, 24 Jun 2020 at 22:10, Marius Bakke  wrote:

> I notice the file name in this command is "attrs_strict".  Probably the
> importer picked the wrong file name and you need to change it to
> (pypi-uri "attrs_strict" version).

Thanks!  Stupid mistake I did. :-)

> Can you paste the full package definition?

Well, I have tried with and without the 'arguments'.

--8<---cut here---start->8---
(define-public python-attrs-strict
  (package
(name "python-attrs-strict")
(version "0.1.0")
(source
  (origin
(method url-fetch)
(uri (pypi-uri "attrs_strict" version))
(sha256
  (base32
"0nldyv053xiv9aaysjszgisi9d9d87f5l2jf3rhl3xm9c9spar96"
(build-system python-build-system)
(native-inputs
 `(("python-pytest" ,python-pytest)
   ("python-pluggy" ,python-pluggy)))
(propagated-inputs
  `(("python-attrs" ,python-attrs)
("python-typing" ,python-typing)))
(arguments
 `(#:phases (modify-phases %standard-phases
  (replace 'check
(lambda _
  (invoke "pytest")
  #t)
(home-page "https://github.com/bloomberg/attrs-strict;)
(synopsis "Runtime validators for attrs")
(description
 "Package that contains runtime validation for @code{attrs} data classes
based on the types existing in the typing module.")
(license license:asl2.0)))
--8<---cut here---end--->8---

Then the Traceback is:

--8<---cut here---start->8---
starting phase `check'
Traceback (most recent call last):
  File 
"/gnu/store/3bk454z353a42l1l4yaxa6lrl3dh24mv-python-pytest-5.3.5/bin/.pytest-real",
 line 11, in 
load_entry_point('pytest==5.3.5', 'console_scripts', 'pytest')()
  File 
"/gnu/store/q9rm8h9imazsq2c4qiv2yjpvlvliywqb-python-3.8.2/lib/python3.8/site-packages/pkg_resources/__init__.py",
 line 489, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
  File 
"/gnu/store/q9rm8h9imazsq2c4qiv2yjpvlvliywqb-python-3.8.2/lib/python3.8/site-packages/pkg_resources/__init__.py",
 line 2852, in load_entry_point
return ep.load()
  File 
"/gnu/store/q9rm8h9imazsq2c4qiv2yjpvlvliywqb-python-3.8.2/lib/python3.8/site-packages/pkg_resources/__init__.py",
 line 2443, in load
return self.resolve()
  File 
"/gnu/store/q9rm8h9imazsq2c4qiv2yjpvlvliywqb-python-3.8.2/lib/python3.8/site-packages/pkg_resources/__init__.py",
 line 2449, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File 
"/gnu/store/3bk454z353a42l1l4yaxa6lrl3dh24mv-python-pytest-5.3.5/lib/python3.8/site-packages/pytest/__init__.py",
 line 6, in 
from _pytest.assertion import register_assert_rewrite
  File 
"/gnu/store/3bk454z353a42l1l4yaxa6lrl3dh24mv-python-pytest-5.3.5/lib/python3.8/site-packages/_pytest/assertion/__init__.py",
 line 5, in 
from typing import Optional
  File 
"/gnu/store/lnbh9ks047sw41b6dc3zk6z1qy4b8cv0-python-typing-3.7.4.1/lib/python3.8/site-packages/typing.py",
 line 1357, in 
class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
  File 
"/gnu/store/lnbh9ks047sw41b6dc3zk6z1qy4b8cv0-python-typing-3.7.4.1/lib/python3.8/site-packages/typing.py",
 line 1005, in __new__
self._abc_registry = extra._abc_registry
AttributeError: type object 'Callable' has no attribute '_abc_registry'
command "pytest" failed with status 1
--8<---cut here---end--->8---

And without the 'replace' i.e., "python setup.py test", the Traceback
is:

--8<---cut here---start->8---
starting phase `check'
running "python setup.py" with command "test" and parameters ()
Traceback (most recent call last):
  File "", line 1, in 
  File "setup.py", line 14, in 
setup(long_description=long_description)
  File 
"/gnu/store/q9rm8h9imazsq2c4qiv2yjpvlvliywqb-python-3.8.2/lib/python3.8/site-packages/setuptools/__init__.py",
 line 145, in setup
return distutils.core.setup(**attrs)
  File 
"/gnu/store/q9rm8h9imazsq2c4qiv2yjpvlvliywqb-python-3.8.2/lib/python3.8/distutils/core.py",
 line 134, in setup
[...]
import typing
  File 
"/gnu/store/lnbh9ks047sw41b6dc3zk6z1qy4b8cv0-python-typing-3.7.4.1/lib/python3.8/site-packages/typing.py",
 line 1357, in 
class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
  File 
"/gnu/store/lnbh9ks047sw41b6dc3zk6z1qy4b8cv0-python-typing-3.7.4.1/lib/python3.8/site-packages/typing.py",
 line 1005, in __new__
self._abc_registry = extra._abc_registry
AttributeError: type object 'Callable' has no attribute '_abc_registry'
command "python" "-c" "import setuptools, 
tokenize;__file__='setup.py';f=getattr(tokenize, 'open', 
open)(__file__);code=f.read().replace('\\r\\n', 
'\\n');f.close();exec(compile(code, __file__, 'exec'))" "test" failed with 
status 1

Re: failing to package attrs-strict for swh.model

2020-06-24 Thread Marius Bakke
zimoun  writes:

> Dear,
>
> I am trying to package "swh.model" which is a CLI tool developed by
> Software Heritage.  It allows to compute SWHID which is their internal
> hash tag.  This package is on PyPI, so I did:
>
>guix import pypi -r swh.model
>
> which returns 2 packages: "python-attrs-srtict" and "swh.model".
>
>
> Aside some minor tweaks about the license, synopsis and description I
> added them to "gnu/packages/python-xyz.scm" and then I simply have tried
> to build:
>
>   ./pre-inst-env guix build python-attrs-strict
>
> Well, the first unexpected thing is an 404 error:
>
> --8<---cut here---start->8---
> building 
> /gnu/store/r6dgvrq486d8hdii9szz2filq85nbwjx-attrs-strict-0.1.0.tar.gz.drv...
>
> Starting download of 
> /gnu/store/9p0baqs1386gv5hhzrv5yrcj35klxpfi-attrs-strict-0.1.0.tar.gz
>>From 
>>https://files.pythonhosted.org/packages/source/a/attrs-strict/attrs-strict-0.1.0.tar.gz...
> download failed 
> "https://files.pythonhosted.org/packages/source/a/attrs-strict/attrs-strict-0.1.0.tar.gz;
>  404 "Not Found"

[...]

> What do I miss?
>
> Then, from the PyPI webpage, I download the tarball by hand (wget) and
> then I run:
>
> /pre-inst-env guix build python-attrs-strict \
>   --with-source=python-attrs-strict=attrs_strict-0.1.0.tar.gz

I notice the file name in this command is "attrs_strict".  Probably the
importer picked the wrong file name and you need to change it to
(pypi-uri "attrs_strict" version).

> which fails at the check phase.  Well, I have added as 'native-inputs'
> the packages "python-pytest" and "python-pluggy".  And I add these
> lines:
>
> --8<---cut here---start->8---
> (arguments
>  `(#:phases (modify-phases %standard-phases
>   (replace 'check
> (lambda _
>   (invoke "pytest")
>   #t)
> --8<---cut here---end--->8---
>
> But the tests is still failing with the same message at this end:
>
> --8<---cut here---start->8---
> AttributeError: type object 'Callable' has no attribute '_abc_registry'
> --8<---cut here---end--->8---

Can you paste the full package definition?


signature.asc
Description: PGP signature


failing to package attrs-strict for swh.model

2020-06-23 Thread zimoun
Dear,

I am trying to package "swh.model" which is a CLI tool developed by
Software Heritage.  It allows to compute SWHID which is their internal
hash tag.  This package is on PyPI, so I did:

   guix import pypi -r swh.model

which returns 2 packages: "python-attrs-srtict" and "swh.model".


Aside some minor tweaks about the license, synopsis and description I
added them to "gnu/packages/python-xyz.scm" and then I simply have tried
to build:

  ./pre-inst-env guix build python-attrs-strict

Well, the first unexpected thing is an 404 error:

--8<---cut here---start->8---
building 
/gnu/store/r6dgvrq486d8hdii9szz2filq85nbwjx-attrs-strict-0.1.0.tar.gz.drv...

Starting download of 
/gnu/store/9p0baqs1386gv5hhzrv5yrcj35klxpfi-attrs-strict-0.1.0.tar.gz
>From 
>https://files.pythonhosted.org/packages/source/a/attrs-strict/attrs-strict-0.1.0.tar.gz...
download failed 
"https://files.pythonhosted.org/packages/source/a/attrs-strict/attrs-strict-0.1.0.tar.gz;
 404 "Not Found"

Starting download of 
/gnu/store/9p0baqs1386gv5hhzrv5yrcj35klxpfi-attrs-strict-0.1.0.tar.gz
>From 
>https://ci.guix.gnu.org/file/attrs-strict-0.1.0.tar.gz/sha256/0nldyv053xiv9aaysjszgisi9d9d87f5l2jf3rhl3xm9c9spar96...
download failed 
"https://ci.guix.gnu.org/file/attrs-strict-0.1.0.tar.gz/sha256/0nldyv053xiv9aaysjszgisi9d9d87f5l2jf3rhl3xm9c9spar96;
 404 "Not Found"

Starting download of 
/gnu/store/9p0baqs1386gv5hhzrv5yrcj35klxpfi-attrs-strict-0.1.0.tar.gz
>From 
>https://tarballs.nixos.org/sha256/0nldyv053xiv9aaysjszgisi9d9d87f5l2jf3rhl3xm9c9spar96...
download failed 
"https://tarballs.nixos.org/sha256/0nldyv053xiv9aaysjszgisi9d9d87f5l2jf3rhl3xm9c9spar96;
 404 "Not Found"

Starting download of 
/gnu/store/9p0baqs1386gv5hhzrv5yrcj35klxpfi-attrs-strict-0.1.0.tar.gz
>From 
>https://archive.softwareheritage.org/api/1/content/sha256:2665757562a9f641611e4e0a5adc412db514757c5f4bed954a3bf651c0f68d5a/raw/...
download failed 
"https://archive.softwareheritage.org/api/1/content/sha256:2665757562a9f641611e4e0a5adc412db514757c5f4bed954a3bf651c0f68d5a/raw/;
 404 "Not Found"
failed to download 
"/gnu/store/9p0baqs1386gv5hhzrv5yrcj35klxpfi-attrs-strict-0.1.0.tar.gz" from 
"https://files.pythonhosted.org/packages/source/a/attrs-strict/attrs-strict-0.1.0.tar.gz;
builder for 
`/gnu/store/r6dgvrq486d8hdii9szz2filq85nbwjx-attrs-strict-0.1.0.tar.gz.drv' 
failed to produce output path 
`/gnu/store/9p0baqs1386gv5hhzrv5yrcj35klxpfi-attrs-strict-0.1.0.tar.gz'
build of 
/gnu/store/r6dgvrq486d8hdii9szz2filq85nbwjx-attrs-strict-0.1.0.tar.gz.drv failed
View build log at 
'/var/log/guix/drvs/r6/dgvrq486d8hdii9szz2filq85nbwjx-attrs-strict-0.1.0.tar.gz.drv.bz2'.
cannot build derivation 
`/gnu/store/yn1vi5ank86870xc75w82pwbpahgv4vx-python-attrs-strict-0.1.0.drv': 1 
dependencies couldn't be built
guix build: error: build of 
`/gnu/store/yn1vi5ank86870xc75w82pwbpahgv4vx-python-attrs-strict-0.1.0.drv'failed
--8<---cut here---end--->8---

What do I miss?

Then, from the PyPI webpage, I download the tarball by hand (wget) and
then I run:

/pre-inst-env guix build python-attrs-strict \
  --with-source=python-attrs-strict=attrs_strict-0.1.0.tar.gz

which fails at the check phase.  Well, I have added as 'native-inputs'
the packages "python-pytest" and "python-pluggy".  And I add these
lines:

--8<---cut here---start->8---
(arguments
 `(#:phases (modify-phases %standard-phases
  (replace 'check
(lambda _
  (invoke "pytest")
  #t)
--8<---cut here---end--->8---

But the tests is still failing with the same message at this end:

--8<---cut here---start->8---
AttributeError: type object 'Callable' has no attribute '_abc_registry'
--8<---cut here---end--->8---

Well, I am not a Python packager expert and I do not know how to
debug. Advices welcome. :-)


All the best,
simon