Code Monkey home page Code Monkey logo

Comments (5)

yurivict avatar yurivict commented on May 10, 2024

pathlib is an old version, now the current version is pathlib2.

from ubelt.

Erotemic avatar Erotemic commented on May 10, 2024

The pathlib module is a standard library module. It's always installed in Python 3.4+
Recent versions of ubelt only support Python 3.6+, but older releases do support other older Python versions.

from ubelt.

yurivict avatar yurivict commented on May 10, 2024

I use python-39 and the test depending on pathlib is skipped because it isn't available.

from ubelt.

Erotemic avatar Erotemic commented on May 10, 2024

Something is wrong. The pathlib module should always be available on 3.9.

What is the result of:

python3 -c "import pathlib; print(pathlib.__file__)"

?

Oh, I think I see the problem now. The test_pathlib test itself is bad.

def test_pathlib():
    try:
        import pathlib
        base = pathlib.Path(ub.ensure_app_cache_dir('ubelt'))
        dpath = base.joinpath('test_pathlib_mkdir')

        # ensuredir
        ub.delete(dpath)
        assert not dpath.exists()
        got = ub.ensuredir(dpath)
        assert got.exists()

        # shrinkuser
        assert ub.shrinkuser(base) == '~/.cache/ubelt'

        assert ub.augpath(base, prefix='foo') == '/home/joncrall/.cache/fooubelt'

        ub.expandpath(base)

    except Exception:
        import pytest
        pytest.skip('pathlib is not installed')

I hardcoded my machine name into it, and the exception catches anything. Changing that line to str(ub.Path('~/.cache/fooubelt').expand()) should work. This is a test from when ubelt still supported 2.7, which is why the try/except is there. It should just be removed now.

from ubelt.

yurivict avatar yurivict commented on May 10, 2024
$ python3.9 -c "import pathlib; print(pathlib.__file__)"
/usr/local/lib/python3.9/pathlib.py

from ubelt.

Related Issues (15)

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.