question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot run tests on nightly

See original GitHub issue

How to reproduce the behaviour

Download spacy nightly and try to run the tests after installing the requirements. Pytest gives the following complaint.

_______________________________ ERROR collecting spacy/tests/regression/test_issue5230.py ________________________________
spacy/tests/regression/test_issue5230.py:89: in <module>
    [nlp(), vectors(), custom_pipe(), tagger(), entity_linker()],
spacy/tests/regression/test_issue5230.py:61: in tagger
    tagger = nlp.add_pipe("tagger")
spacy/language.py:687: in add_pipe
    pipe_component = self.create_pipe(
spacy/language.py:585: in create_pipe
    resolved, filled = registry.resolve(cfg, validate=validate)
../../anaconda3/envs/project/lib/python3.8/site-packages/thinc/config.py:542: in resolve
    filled, _, resolved = cls._fill(
../../anaconda3/envs/project/lib/python3.8/site-packages/thinc/config.py:631: in _fill
    filled[key], validation[v_key], final[key] = cls._fill(
../../anaconda3/envs/project/lib/python3.8/site-packages/thinc/config.py:692: in _fill
    result = schema.parse_obj(validation)
pydantic/main.py:455: in pydantic.main.BaseModel.parse_obj
    ???
pydantic/main.py:344: in pydantic.main.BaseModel.__init__
    ???
pydantic/main.py:874: in pydantic.main.validate_model
    ???
E   pydantic.errors.ConfigError: field "nlp" not yet prepared so type is still a ForwardRef, you might need to call ArgModel.update_forward_refs().
================================================ short test summary info =================================================
ERROR spacy/tests/regression/test_issue5230.py - pydantic.errors.ConfigError: field "nlp" not yet prepared so type is s...
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Your Environment

  • spaCy version: 3.0.0a7
  • Platform: Linux-4.15.0-112-generic-x86_64-with-glibc2.10
  • Python version: 3.8.5
➜  spaCy git:(5fdd6b460) pip show thinc
Name: thinc
Version: 8.0.0a27
Summary: A refreshing functional take on deep learning, compatible with your favorite libraries
Home-page: https://github.com/explosion/thinc
Author: Explosion
Author-email: contact@explosion.ai
License: MIT
Location: /home/user/anaconda3/envs/project/lib/python3.8/site-packages
Requires: numpy, murmurhash, srsly, setuptools, preshed, wasabi, pydantic, catalogue, cymem
Required-by: spacy-nightly

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
tiangolocommented, Oct 15, 2020

Thanks for the patience @svlandeg and @forgetso !

First, yeah, I have seen that error several times in other projects using Pydantic 😬 😅

Nevertheless, I started from a clean slate and I couldn’t reproduce the error in spaCy 😕

…But it took me a bit of work to actually start from a “clean slate”, and I think the error could be coming from one of the several “caches” interacting in this.

@forgetso could you try this?:

// Make sure to pull the latest changes
$ git pull upstream develop

// Clean any built Cython modules/binaries
$ make clean

// Create a new venv (just to be sure)
$ python3.8 -m venv env-2020-10-15

// Activate it
$ source env-2020-10-15/bin/activate

// Update pip and the building requirements
$ python -m pip install --upgrade pip setuptools wheel

// Install the spaCy requirements, making sure to upgrade
// The upgrade here is important even in a new environment as pip could use its local cache and use an old version of some package
$ python -m pip install --upgrade -r requirements.txt

// Then install spaCy in that venv, that will trigger the Cython build, so it will take a bit
$ python -m pip install -e .

// Activate the venv again to make sure you are using the pytest from the venv
$ source env-2020-10-15/bin/activate

// Then run pytest again
$ pytest spacy/tests/regression
2reactions
forgetsocommented, Nov 12, 2020

@tiangolo thanks. Updating setup tools and requirements seems to have done the trick.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unit Tests and Nightly Build - MSDN - Microsoft
I have a team using VS for Software Developers and I want to run the unit tests using Team Build. VS for SD...
Read more >
Tests not running in Test Explorer - visual studio
All tests are running, all tests are showing the right test outcome. However, the tests are not running when using the Visual Studio...
Read more >
Unit testing - GROMACS 2024-dev-20221124-bb312a6 ...
Some tests are skipped because they cannot run with the number of MPI ranks or GPU devices detected. Explicit information about such cases...
Read more >
Test execution pauses during nightly runs when exc...
Hi, I have a query regarding a functionality.Whenever we run tests,sometimes some page is not opened in time or an object is not...
Read more >
Nightly Builds Test against real database
The fact that you mention nightly builds, as opposed to continuous integration where builds run after each commit might indicate that the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found