Git Product home page Git Product logo

Comments (8)

sveetch avatar sveetch commented on July 22, 2024

It seems a problem with threads and popen usage. Boussole stands on watchdog for the watch mode and it did have some issues with this kind of usage.

As i know, Boussole don't keep any unclosed files and i never tried to use Boussole in the same way you did.

Maybe you could try to directly use the watchdog script "watchmedo" with "boussole compile ..." to see if it changes anything. If the issue is still the same, it probably comes from watchdog, else it the issue does not appear anymore this should be a bug from Boussole.

As for now i don't have any idea of a solution yet, let me know if you found something new.

from boussole.

sveetch avatar sveetch commented on July 22, 2024

I forget to advise that with the watchmedo + boussole compile, obviously you will have to define yourself the sources to watch, which is not as efficient than the boussole watch that make some smart inspection about source inheritance.

from boussole.

kopax-polyconseil avatar kopax-polyconseil commented on July 22, 2024

Hi and thanks @sveetch for your fast reply, it is well appreciated !

I am not sure we use watchdog in our project and I am afraid to propose to add new library for this purpose, I already had to negotiate to get libsass and boussole :D

This seems like a common use case for webpack dev server, I was expecting to get the same experience in python development, but if I understand right, your advice is to run boussole along the python process?

This is actually the fix I was thinking of, but I hope there was a way or fix that could avoid that extreme solution.

from boussole.

sveetch avatar sveetch commented on July 22, 2024

I am not sure we use watchdog in our project and I am afraid to propose to add new library for this purpose, I already had to negotiate to get libsass and boussole :D

Watchdog itself is a requirement from Boussole so if you have Boussole installed you already got watchdog. However the solution i was giving use an extra dependency from watchdog (called watchmedo) so it may not fit to your constraints.

Honestly i don't know what is going on with your script, i looked at your exceptions and the ImportError does not really seems to involve a PID problem, but you truncated the stacktrace so i can't trace from where it is happening.

I never used watch mode through a subprocess so i can ensure this is related or not to watchdog, as fas as i know Boussole is not playing with imports, process or threads.

from boussole.

kopax-polyconseil avatar kopax-polyconseil commented on July 22, 2024

Hello, I just opened a pull request to remove this features, but before mergin, I'd like to know stacktrace I can give you to help your further.

This is how my console look like:

/home/dka/workspace/github.com/pass-culture/pass-culture-main/api/env/bin/python /srv/pycharm-2022.3.3/plugins/python/helpers/pydev/pydevd.py --module --multiprocess --qt-support=auto --client 127.0.0.1 --port 45975 --file pcapi.backoffice_app 
warning: PYDEVD_USE_CYTHON environment variable is set to 'NO'. Frame evaluator will be also disabled because it requires Cython extensions to be enabled in order to operate correctly.
Connected to pydev debugger (build 223.8836.43)
💅 Scss compiler attached and watching, enjoy styling 💅
 * Serving Flask app 'pcapi.flask_app' (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: on
warning: PYDEVD_USE_CYTHON environment variable is set to 'NO'. Frame evaluator will be also disabled because it requires Cython extensions to be enabled in order to operate correctly.
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/shutil.py", line 713, in rmtree
ImportError: sys.meta_path is None, Python is likely shutting down
warning: PYDEVD_USE_CYTHON environment variable is set to 'NO'. Frame evaluator will be also disabled because it requires Cython extensions to be enabled in order to operate correctly.
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/shutil.py", line 713, in rmtree
ImportError: sys.meta_path is None, Python is likely shutting down
warning: PYDEVD_USE_CYTHON environment variable is set to 'NO'. Frame evaluator will be also disabled because it requires Cython extensions to be enabled in order to operate correctl

How should I give you more verbose logs ?

from boussole.

sveetch avatar sveetch commented on July 22, 2024

I don't know for the verbose logs, commonly a traceback is longer that yours, but it does not seems there is more to see.

Whatever, i've just seen the exception comes from usage of shutil.rmtree but there is not any from Boussole code and i've also searched through watchdog and it does not use it ever.

I think your problem is higher level in your script or else, but searching for rmtree in your code and its requirements could help you to find the real cause.

from boussole.

kopax-polyconseil avatar kopax-polyconseil commented on July 22, 2024

searching for rmtree in your code and its requirements could help you to find the real cause.

Our repository is public : https://github.com/pass-culture/pass-culture-main

I think your problem is higher level in your script or else

I can only disagree as this problem started when I added subprocess boussole from our python app, and goes away as soon as I remove this subprocess from boussole.

This bug also happen while we just edit html or py code (we reload our flask service on .py edition), it's not just only while editing scss, but it was working fine before, and it work fine if we do not run boussole from py, perhaps this could be a reason.

from boussole.

kopax-polyconseil avatar kopax-polyconseil commented on July 22, 2024

I'll close the issue as I am in the process to revert this feature. Thanks for helping !

from boussole.

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.