GithubHelp home page GithubHelp logo

Comments (7)

brandon-rhodes avatar brandon-rhodes commented on July 28, 2024

Assay is working fine under Python 3.8 on my own system, so we need to uncover how the underlying OS calls are behaving differently on yours. Looking at where that list of paths is coming from that apparently contains a None on your system:

  File "/usr/lib64/python3.8/posixpath.py", line 152, in dirname
    p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType

— it looks like it comes from the routine list_module_paths() in iteration.py, because that's where main_loop() gets its list main_process_paths. The routine gets the paths like this:

def list_module_paths():
    items = list(sys.modules.items())
    return [(name, module.__file__) for name, module in items
            if (module is not None) and hasattr(module, '__file__')]

So there must be a module in your Python that has a __file__ attribute, but for which its value is None? I have never seen that before. Right next to the line that sets main_process_paths in main_loop(), you could try:

    print('Crazy:', [name for name, path in list_module_paths() if path is None])

— and we would maybe get the name of the module with the unexpected __file__ value. If 3.8 has simply added such modules and they will be normal from now on, then we can tweak list_module_paths() to ignore None values. (But first I'm very interested in finding out where it's coming from!)

As for your second run: it looks like the assert rewriting ran into trouble? Before having you spend any time on it, I'll today or tomorrow go add the CI for assay that I mentioned the other day, to see if there's a 3.8 issue I can squash on this end before incurring any further time of yours. If I can't reproduce it here or in CI, then I'll comment further on this issue for information about what's going on in your system.

from assay.

bnavigator avatar bnavigator commented on July 28, 2024
abuild@greinerT450s:~/rpmbuild/BUILD/skyfield-1.24> python3 -m assay skyfields.tests
Crazy: ['mpl_toolkits']
Traceback (most recent call last):
  File "/usr/lib64/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib64/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/abuild/rpmbuild/BUILD/assay-18f320237345813a49173657e7d2d6ca85e9a38a/assay/__main__.py", line 2, in <module>
    main()
  File "/home/abuild/rpmbuild/BUILD/assay-18f320237345813a49173657e7d2d6ca85e9a38a/assay/command.py", line 22, in main
    monitor.main_loop(args.name, args.batch or not isatty)
  File "/home/abuild/rpmbuild/BUILD/assay-18f320237345813a49173657e7d2d6ca85e9a38a/assay/monitor.py", line 45, in main_loop
    file_watcher.add_paths(main_process_paths)
  File "/home/abuild/rpmbuild/BUILD/assay-18f320237345813a49173657e7d2d6ca85e9a38a/assay/filesystem.py", line 80, in add_paths
    paths = set(dirname(path) for path in file_paths) - self.paths
  File "/home/abuild/rpmbuild/BUILD/assay-18f320237345813a49173657e7d2d6ca85e9a38a/assay/filesystem.py", line 80, in <genexpr>
    paths = set(dirname(path) for path in file_paths) - self.paths
  File "/usr/lib64/python3.8/posixpath.py", line 152, in dirname
    p = os.fspath(p)
abuild@greinerT450s:~/rpmbuild/BUILD/skyfield-1.24> ls /usr/lib64/python3.8/site-packages/mpl_toolkits/
axes_grid  axes_grid1  axisartist  mplot3d  tests

mpl_toolkits is shipped with matplotlib. Now why the __init__.py is missing, I have no idea yet (I updated the package myself a few days ago. Maybe my fault...)

from assay.

bnavigator avatar bnavigator commented on July 28, 2024

From the matplotlib package buildlog during install_lib:
[ 108s] Skipping installation of /home/abuild/rpmbuild/BUILDROOT/python-matplotlib-3.3.0-38.1.x86_64/usr/lib64/python3.8/site-packages/mpl_toolkits/__init__.py (namespace package)

https://packaging.python.org/guides/packaging-namespace-packages/

from assay.

brandon-rhodes avatar brandon-rhodes commented on July 28, 2024

Thank you! That solves the mystery. Probably tomorrow I'll have time to get a fix committed.

from assay.

brandon-rhodes avatar brandon-rhodes commented on July 28, 2024

Thanks for letting me know about the dangers of new PEP 420 namespace packages! I've committed both a fix and a test, so hopefully this will stay fixed.

from assay.

bnavigator avatar bnavigator commented on July 28, 2024

Can confirm, the skyfield tests now pass in batch mode.

Without batch, after running all the tests, it still needs a keyboard interrupt to terminate the process. Is this intentional?

As there is no need to rewrite any assertion failures with the current passing skyfield package, I cannot confirm that this has been fixed.

Filing another issue with failures on ARM and PowerPC shortly.

from assay.

brandon-rhodes avatar brandon-rhodes commented on July 28, 2024

Without batch, after running all the tests, it still needs a keyboard interrupt to terminate the process. Is this intentional?

Yes, intentional: without --batch, assay runs in interactive mode where it re-runs the tests immediately when the developer hits Save on an edit to a Python file.

As there is no need to rewrite any assertion failures with the current passing skyfield package, I cannot confirm that this has been fixed.

Assertion rewriting is, happily, tested directly in assay’s own test suite, which now passes under 3.8 following that Python version’s update to the fields supported by raw Python code objects:

21554af

from assay.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.