Skip to content

TypeError: attrib() got an unexpected keyword argument 'converter' #449

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

Closed
dhimmel opened this issue Aug 7, 2018 · 7 comments
Closed

TypeError: attrib() got an unexpected keyword argument 'converter' #449

dhimmel opened this issue Aug 7, 2018 · 7 comments

Comments

@dhimmel
Copy link

dhimmel commented Aug 7, 2018

In a Travis CI linux build on Python 3.6, I am getting an odd error:

E   TypeError: attrib() got an unexpected keyword argument 'converter'

The errors occurs in the following line of jsonschema:

https://github.com/Julian/jsonschema/blob/bb92111a85c981d14788257ebc0885f272b17e40/jsonschema/_types.py#L64

Windows builds passed. These builds are for manubot/manubot@34de1a6 of manubot/manubot#49.

Interestingly, the tests pass locally for me on Linux. From the test log, it seems that the error is being triggered upon import. Possibly related to pytest.

@dhimmel
Copy link
Author

dhimmel commented Aug 7, 2018

Possibly related to pytest-dev/pytest#3280 or pytest-dev/pytest#3228.

The environments:

# Travis pytest version info (failing)
platform linux -- Python 3.6.3, pytest-3.3.0, py-1.5.2, pluggy-0.6.0
# Local pytest version info (passing)
platform linux -- Python 3.6.4, pytest-3.3.0, py-1.5.2, pluggy-0.6.0

Very similar. Perhaps has to do with how pytest is installed? Locally, I'm using conda.

@dhimmel
Copy link
Author

dhimmel commented Aug 7, 2018

Looking further, likely related to this library: https://github.com/python-attrs/attrs

@hynek or @Tinche any idea?

@hynek
Copy link
Contributor

hynek commented Aug 8, 2018

Your attrs version is too old. It used to be convert which is now deprecated and called converter instead

@Julian
Copy link
Member

Julian commented Aug 8, 2018

@dhimmel jsonschema should already be declaring that it needs attrs>17.4 -- just in case that was added after v3.0.0a1, I just pushed a v3.0.0a2, but there's also a small chance you are depending on some library that is pinning attrs to below 17.4.0.

Try re-running your build now and see if it still fails?

Will close this since jsonschema's own test suite is passing here so I'm pretty sure the bug would be elsewhere, but leave a comment if you have any issues.

@Julian Julian closed this as completed Aug 8, 2018
@dhimmel
Copy link
Author

dhimmel commented Aug 8, 2018

jsonschema should already be declaring that it needs attrs>17.4.

Ah I see

https://github.com/Julian/jsonschema/blob/8f9460fea08cb2a24554852f9bc0041213e3d804/setup.cfg#L27

Okay I am using jsonschema 2.6.0 locally (latest version on PyPI). It looks like failed Travis build used jsonschema 3.0.0a1 and attrs 18.1.0.

Let me wipe the Travis pip cache and rerun.

dhimmel added a commit to dhimmel/manubot that referenced this issue Aug 8, 2018
@dhimmel
Copy link
Author

dhimmel commented Aug 8, 2018

Let me wipe the Travis pip cache and rerun.

That did not fix. However, I switched to installing the manubot package on Travis using pip install . rather than python setup.py install in manubot/manubot@ec10ec6. The new Travis build passed!

I believe python setup.py install was using easy_install rather than pip, but not sure why this would cause the outdated version of attrs when it claimed to be installing 18.1.0. Anyways, I'm happy since the build is passing, so not likely to dig further unless this issue reappears.

@Julian
Copy link
Member

Julian commented Aug 8, 2018 via email

dhimmel added a commit to dhimmel/manubot that referenced this issue Aug 12, 2018
Refs manubot#47

CSL: replace arxiv_id with archive_location

Travis: install package using pip

Attempt to fix
python-jsonschema/jsonschema#449

--prune-csl option for manubot cite

Only remove a single additional property sub_error

Workaround the effect of
citation-style-language/schema#154

Switch to dhimmel/schema CSL JSON

Move validation to remove_jsonschema_errors

Test CSL pruning

Improve CSL pruning documentation

Default to pruning unless --bad-csl flag supplied

DOI CSL retriever: use shortDOI for URL

Switch CSL pruning logging to DEBUG

Update manubot cite help in README

arxiv citeproc: use int for date-parts
dhimmel added a commit to dhimmel/manubot that referenced this issue Aug 13, 2018
Prune CSL Items to validate JSON schema

Refs manubot#47

CSL: replace arxiv_id with archive_location

Travis: install package using pip

Attempt to fix
python-jsonschema/jsonschema#449

--prune-csl option for manubot cite

Only remove a single additional property sub_error

Workaround the effect of
citation-style-language/schema#154

Switch to dhimmel/schema CSL JSON

Move validation to remove_jsonschema_errors

Test CSL pruning

Improve CSL pruning documentation

Default to pruning unless --bad-csl flag supplied

DOI CSL retriever: use shortDOI for URL

Switch CSL pruning logging to DEBUG

Update manubot cite help in README

arxiv citeproc: use int for date-parts
dhimmel added a commit to dhimmel/manubot that referenced this issue Aug 14, 2018
Prune CSL Items to validate JSON schema

Refs manubot#47

CSL: replace arxiv_id with archive_location

Travis: install package using pip

Attempt to fix
python-jsonschema/jsonschema#449

--prune-csl option for manubot cite

Only remove a single additional property sub_error

Workaround the effect of
citation-style-language/schema#154

Switch to dhimmel/schema CSL JSON

Move validation to remove_jsonschema_errors

Test CSL pruning

Improve CSL pruning documentation

Default to pruning unless --bad-csl flag supplied

DOI CSL retriever: use shortDOI for URL

Switch CSL pruning logging to DEBUG

Update manubot cite help in README

arxiv citeproc: use int for date-parts
dhimmel added a commit to dhimmel/manubot that referenced this issue Aug 16, 2018
Prune CSL Items to validate JSON schema

Refs manubot#47

CSL: replace arxiv_id with archive_location

Travis: install package using pip

Attempt to fix
python-jsonschema/jsonschema#449

--prune-csl option for manubot cite

Only remove a single additional property sub_error

Workaround the effect of
citation-style-language/schema#154

Switch to dhimmel/schema CSL JSON

Move validation to remove_jsonschema_errors

Test CSL pruning

Improve CSL pruning documentation

Default to pruning unless --bad-csl flag supplied

DOI CSL retriever: use shortDOI for URL

Switch CSL pruning logging to DEBUG

Update manubot cite help in README

arxiv citeproc: use int for date-parts
ramou pushed a commit to ramou/boutiques that referenced this issue Mar 10, 2019
[This](python-jsonschema/jsonschema#449) suggests the
issue might be related to minimum requirements for attrs module causing
the problem. The specific error matches. There's a later suggestion
about Travis badly using setup.py/easytools instead of pip install being
a culprit, but I'll try this first.
jonathansick added a commit to lsst-sqre/lsst-projectmeta-kit that referenced this issue Apr 2, 2019
This fixes this pytest error:

pytest --flake8 --doctest-modules lsstprojectmeta tests
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.6.3/bin/pytest", line 7, in <module>
    from pytest import main
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/pytest.py", line 14, in <module>
    from _pytest.fixtures import fillfixtures as _fillfuncargs
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/_pytest/fixtures.py", line 971, in <module>
    class FixtureFunctionMarker(object):
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/_pytest/fixtures.py", line 973, in FixtureFunctionMarker
    params = attr.ib(converter=attr.converters.optional(tuple))
TypeError: attrib() got an unexpected keyword argument 'converter'
make: *** [test] Error 1

The solution is discussed in python-jsonschema/jsonschema#449
jonathansick added a commit to lsst-sqre/lsst-projectmeta-kit that referenced this issue Apr 2, 2019
This fixes this pytest error:

pytest --flake8 --doctest-modules lsstprojectmeta tests
Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.6.3/bin/pytest", line 7, in <module>
    from pytest import main
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/pytest.py", line 14, in <module>
    from _pytest.fixtures import fillfixtures as _fillfuncargs
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/_pytest/fixtures.py", line 971, in <module>
    class FixtureFunctionMarker(object):
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/_pytest/fixtures.py", line 973, in FixtureFunctionMarker
    params = attr.ib(converter=attr.converters.optional(tuple))
TypeError: attrib() got an unexpected keyword argument 'converter'
make: *** [test] Error 1

The solution is discussed in python-jsonschema/jsonschema#449
metazool pushed a commit to softwareunderground/subsurface-journal that referenced this issue May 9, 2019
soxofaan added a commit to soxofaan/openeo-backend-validator that referenced this issue Jun 19, 2019
soxofaan added a commit to soxofaan/openeo-backend-validator that referenced this issue Jun 19, 2019
RMeli added a commit to RMeli/qml that referenced this issue Sep 16, 2019
kolanos added a commit to iopipe/iopipe-python that referenced this issue Oct 4, 2019
jan-kiszka added a commit to siemens/kas that referenced this issue Oct 4, 2019
Fixes pytest breakage on Python 3.6 in Travis. See also
python-jsonschema/jsonschema#449

Signed-off-by: Jan Kiszka <[email protected]>
jan-kiszka added a commit to siemens/kas that referenced this issue Oct 4, 2019
Fixes pytest breakage on Python 3.6 in Travis. See also
python-jsonschema/jsonschema#449

Signed-off-by: Jan Kiszka <[email protected]>
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

No branches or pull requests

3 participants