Code Monkey home page Code Monkey logo

Comments (11)

jfowkes avatar jfowkes commented on August 18, 2024

Thank you very much!

Regarding your issue, we do actually have a fallback in that PyCUTEst will default to using the current working directory to store the cache if the ${PYCUTEST_CACHE} environment variable is not defined (see the end of system_paths.py), although I realise that we have probably not documented this anywhere and we should really make this behaviour clear in the README and documentation.

from pycutest.

payoto avatar payoto commented on August 18, 2024

I see that default now, good to know! I'll have a bit of time in the next couple of weeks where I can probably document that and PR it.

What would you think of pycutest adding the contents of the ${PYCUTEST_CACHE} variable to the python path automatically? (or at least providing a function to do it automatically). Would you be interested in a PR doing that?

(sorry for the slow response btw)

from pycutest.

jfowkes avatar jfowkes commented on August 18, 2024

No worries, a documentation PR for the default cache handling would be much appreciated, many thanks!

Regarding pycutest automatically adding the contents of ${PYCUTEST_CACHE} to the python path, I will have to ask my co-author who wrote the environment variable handling code. @lindonroberts do you think this would be a good idea?

from pycutest.

lindonroberts avatar lindonroberts commented on August 18, 2024

I think adding PYCUTEST_CACHE to the Python path automatically would be a nice feature. This would simplify the installation a little bit too (only needing to set PYCUTEST_CACHE and not PYTHONPATH). Happy for a PR on this

from pycutest.

lindonroberts avatar lindonroberts commented on August 18, 2024

Because I had to deal with this today, a code snippet I needed to update the Python path at runtime to include PYCUTEST_CACHE:

import os, sys
try:
    sys.path.index(os.environ['PYCUTEST_CACHE'])
except ValueError:
    sys.path.append(os.environ['PYCUTEST_CACHE'])

In our case it would be similar, but with get_cache_path() instead of os.environ['PYCUTEST_CACHE'], so

import sys
try:
    sys.path.index(get_cache_path())
except ValueError:
    sys.path.append(get_cache_path())

It would make sense for this to go at the end of __init__.py, since that also does things like check existence of environment variables.

from pycutest.

jfowkes avatar jfowkes commented on August 18, 2024

Sounds good to me, would be great to have this feature if you're able to add it?

from pycutest.

lindonroberts avatar lindonroberts commented on August 18, 2024

Reopening as a reminder to mention the "if environment variable not available use the current directory" behavior in the documentation

from pycutest.

jfowkes avatar jfowkes commented on August 18, 2024

Many thanks! I guess we should probably think about a new release with updated docs soon?

from pycutest.

lindonroberts avatar lindonroberts commented on August 18, 2024

I agree - to this end in commit f0b5427 I have updated:

  • Increased version number to 1.1
  • Documentation to include simplified installation (remove any reference to updating PYTHONPATH), updated version history. I set the release date to 14 Feb to give @jfowkes time to check things over
  • Misc documentation changes: updated index.rst to use my homepage rather than (old) email, updated link for Windows/WSL info

from pycutest.

jfowkes avatar jfowkes commented on August 18, 2024

Fantastic, thank you very much @lindonroberts for this addition and for the comprehensive docs update. This looks great to me, please release the new release!

from pycutest.

lindonroberts avatar lindonroberts commented on August 18, 2024

@jfowkes - I've tagged release v1.1 and made it available on pyPI (https://pypi.org/project/pycutest/)

from pycutest.

Related Issues (20)

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.