Comments (11)
I still can't reproduce it but you're right, there is some custom logic around parsing future imports.
I'll have a look into that.
from reloadium.
Are you sure you're running it under 3.12? 3.12 is not supported yet.
from reloadium.
Whoops, sorry I'm a bit new to pycharm. Looks like I'm running python 3.8 with from __future__ import annotations
at the top of my script
from reloadium.
Have been googling for the last hour and haven't found anyone else mention this problem or how to resolve it, any tips?
from reloadium.
Correct usage would be:
from typing import Set
buttons: Set[int]
I'm closing this since it's not related to Reloadium
from reloadium.
In my opinion this is definitely a bug. I'm using a supported version of python (according to your docs) and I'm getting undesirable behavior due to perfectly acceptable python typing. If this doesn't intend to be supported, perhaps it could be documented somewhere at least?
from typing import Set
buttons: Set[int]
You've shown an example of the old-style annotations,
The annotation style (lowercase set) is perfectly acceptable in python 3.8 if you import from __future__ import annotations
at the top of your script.
from reloadium.
To add, we have a library of hundreds of python scripts using the future annotation syntax. To my knowledge I don't believe there's a tool that'll auto downgrade to the old style. I know tools like Ruff and pyupgrade will automatically convert to future annotations however.
from reloadium.
I see what you mean but I can't reproduce it.
Can you provide a reproducer?
from reloadium.
I was struggling to get consistent results, as there didn't seem to be a command to get Reloadium to simply just try to parse a single file. After a bit of experimentation, I finally was able to get it to throw an error in a script consistently, without any non-builtin dependencies.
https://github.com/NickHugi/PyKotor/blob/master/Libraries/Utility/src/utility/system/path.py
From what I gather your parser needs to be doing two things:
- Determining if
from __future__ import annotations
is at the top of the file. - Ensure Reloadium isn't trying to parse code that's not runtime-available. Check if the errored annotation is in a TYPE_CHECKING block
It might be easier to import something like ruff/pylint to do quick checks like this. Another potential idea is to expose a checkbox in the settings to disable Reloadium's syntax checks. In my scenario, the only thing I want Reloadium to do is reload the changed code/affected modules: I couldn't care less about whether it finds an error in the code.
from reloadium.
In the above example, I have the following import structure, compliant with PEP 563
from __future__ import annotations
import contextlib
import os
import pathlib
import re
import subprocess
import sys
import uuid
from tempfile import TemporaryDirectory
from typing import TYPE_CHECKING, Any, Union
from utility.error_handling import format_exception_with_variables
if TYPE_CHECKING:
from collections.abc import Callable, Generator
from typing_extensions import Self
from reloadium.
Fixed in Reloadium 1.4.1 and PyCharm plugin 1.4.1
from reloadium.
Related Issues (20)
- Fast debug does not stop on breakpoints. HOT 3
- not support WSL HOT 3
- Not support numba HOT 1
- Reloadium appears to not support debugging on remote servers. While it works fine during local testing, it fails to update on servers. HOT 4
- Reloadium debugger shows filtered log messages in django HOT 3
- Reloadium fails to start HOT 1
- Can't start debugger on Pycharm 2023.3 EAP HOT 7
- ModuleNotFoundError: No module named 'reloadium.corium' HOT 2
- Reloadimun not reloading modified pyhton files HOT 3
- Reloadium fails to start HOT 2
- VSCode plugin roadmap HOT 1
- Reloadium profiler not displayed HOT 1
- [Feature Request] Frame Transaction
- pydevd_process_net_command.py this file frequently wrong as UnicodeDecodeError
- Docker-compose interpreter, /opt/conda/bin/python3: No module named reloadium_launcher HOT 1
- Error when exit() in interact shell HOT 1
- Issue with Reloadium in PyCharm+WSL HOT 3
- [Feature request] Request for Feature to Modify OpenAI's BaseURL
- Hot reloading of HTML files not working with reloadium (works fine with just webpack-dev-server and python manage.py runserver) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reloadium.