-
-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Empty environment variables on IntelliJ IDEA 2022.2 (Community Edition) #185
Comments
Same issue is happening with IntelliJ IDEA 2022.2 (Ultimate Edition) as well.
|
Same here.
|
Same for me.
|
Same. I have a stack trace: stack trace
|
Same error here |
Having the same error. |
Existing feature request for making this a native feature of the IDE: https://youtrack.jetbrains.com/issue/IDEA-137820 |
oof. ... Those feature requests are 11 and 7 years old respectively. |
This issue is fixed in the master branch of this repo (see #158 ), which has not yet been published. You can install it by building from source and adding the plugin from the generated zip file. I have tried it and the issue of empty env vars persists, which means it unfortunately is not related to this exception and there is no fix available yet... 😞 |
I'm not a user of the EnvFile plugin, but I'm subscribed to updates on PY-5543 and I saw a comment about the recent version incompatibility. For EnvFile users with simple
patch-env doesn't do environment variable substitution or support or other input formats, but it will run any command you specify to get its input, so you can be creative with how the variable data gets assembled. |
For those wanting to employ then patch_env solution with an env file local to your script/module path, you can use something like this:
|
@KhanMechAI Use: |
For me, installing Pycharm Professional 2021.3.3 fixed the issue. You can do it here https://www.jetbrains.com/pycharm/download/other.html |
@larrykooper degrading of your PyCharm version is not the issue fix |
@ashald Is this project being maintained? Is there a fix for this issue on the horizon? |
@ashald previous time fix took a lot of time. So it's rarely supported |
Same here :( |
Same issue here |
Here's a bash script which would allow to easily concatenate the contents of multiple .env files. #!/bin/bash
# Documentation here :
# https://gist.github.com/dehidehidehi/6c92f618e4d841e6cc8b2dce8a3b0b7d
# Here's a bash script which would allow to easily concatenate the contents of multiple .env files.
# Just save this script and pass the .env file path (relative or absolute) as arguments.
ENV_VARS_LIST=""
for envFile in $@
do
grep -Ev '(#|^$)' $envFile
done
# Credits:
# The base idea for this script is credited to
# https://github.com/sterwill
# Grep idea is credited to
# https://github.com/mousomer
Examples usage: Here's the link to the gist in case I update the code. |
Got same issue in PyCharm 2022.2.1 Professional Edition. Build #PY-222.3739.56, built on August 16, 2022 Runtime version: 17.0.3+7-b469.37 amd64 It worked before IDE update, but now I get empty env variables in any existing/new run configurations. |
Same issue, PyCharm 2022.2.1 Pro. |
@ashald Do you plan to fix this issue or is this project abandoned already? |
@ashald are u planning to fix this? |
I can't quite figure out why it's broken, but I managed to get the plugin working in pycharm using an experimental internal API. Releases here | Diff | CI for the release Notes for developers: Small update: I managed to find from the Go EP that the patchCommandLine method is actually deprecated, though that isn't marked on the base class that all these EPs inherit from, nor is it marked on the python EP. No alternative is proposed. The most consistent thing about the intellij plugin platform is how terrible an experience it is. |
@HassanAbouelela thank you so much for this. Really looking forward to a stable solution. |
Follow up: I have some bad news, and some good news. I asked on the slack again, and this time I got confirmation that this is in fact a bug! This most likely means that the plugin will not work in 2022.2 (unless we find other workarounds like the one for pycharm). The good news is that this is a bug, and hopefully will be fixed or we'll get an alternative. I'll update this issue with a YouTrack issue later. |
It's exciting to see how many people use the plugin judging from the number of complaints about it breaking. I wish it correlated with number of Github Sponsor donations to support plugin development. Or at least with a number of pull requests contributing fixes. I personally don't have a need to use the latest version of IDE and been perfectly fine using older versions, though as I plan to add few extra features I'll look into fixing compatibility with the latest versions. |
@ashald I can't speak for anyone else but I personally would be willing to support you financially with Paypal if you had one linked on your profile. 😄 Can't deny your plugin has been very helpful with my Pycharm usage |
Sponsor here > https://github.com/sponsors/ashald PS. @ashald please setup One-time tiers :) |
Hi @ashald! Thank you for creating such a popular plugin! I work at JetBrains and we'll be happy to provide a pull request to fix 2022.2 compatibility! (we had a huge refactoring in the 2022.2 release and most likely that was the reason of the broken plugin). Unfortunately, we didn't notice it earlier. Would you be interested in such pull request? (asking just to make sure you're not working on it at the moment, so we won't do the same job twice) |
@ashald I am sorry, but it looked like you abandoned the repo. I am using @HassanAbouelela's fork at the moment. |
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
We have plans to implement this functionality as part of the product but later. Implementing a fix for the existing popular plugin is the fastest solution we can provide at the moment. Sorry for the inconvenience! |
Maybe you could just pay the authors to support the plugins and keep them in the loop for breaking changes. The practice of using community contributors for free to discover what features are in demand, and them discarding their work in favor of internal implementations is questionable. I guess you are the ones that should setup a sponsorship on @ashald account ;P |
I think this change would've been apparent in early builds of 2022.2 but there definitely could've been more done to communicate any of this. The refactoring was not documented anywhere to my knowledge, and not listed in the breaking changes list. The APIs are still accessible and documented, despite being unable to access them for some IDEs (IntelliJ). They are also inconsistently documented, with some of the APIs marking certain methods as deprecated (Go deprecated the function this plugin uses, but none of the other EPs nor the base EP have the same deprecation). I also heard about a new run API in the slack community, but I'm honestly not sure where that is. (This is more feedback for plugins and documentation in general, not for plugin developers). |
@Elizaveta239 just to clarify, you mean essentially make this plugin unnecessary? |
@modernNeo thanks, noted - will update profile/readme to include links just in case you or anyone else would be feeling like doing so. 😊 @wooyek done! @Elizaveta239 would appreciate a contribution! Please note I pushed some changes to update some of the dependencies. Also, would appreciate if you could clarify if the changes are only required for PyCharm, or if we should migrate to some new API for other platforms such as Goland/RubyMine. And of course if such functionality would make make its way into JetBrains IDEs natively, I'd be more than happy to deprecate this plugin. Thought, IMHO, the best thing JetBrains could do is address https://youtrack.jetbrains.com/issue/IDEA-288756 so that not any developer willing to implement a plugin to add extra environment variables would have a cross-platform way to do so. @RockyMM glad you found something that works for you! That being said, looking at your profile, you seem to have quite a few Java repos... which makes me wonder what stops people like you from contributing fixes rather than just commenting on issues like this, It's OSS after all. @HassanAbouelela agree! the most challenging part of developing this plugin was to reverse-engineer ambiguous parts of plugin interface for run configurations. |
@ashald Borys, that's not fair. I have a fair share of contributions to OSS - Liquibase, openapi-generator. I am in a position where my free time is extremely limited. I think that given my free time I gave back to the community. I only took a quick look at this repo and saw open PRs from 2020. It really felt neglected. I know this plugin is fully OSS, but I did not feel it would be right that anyone ports Hassan's solution back upstream, even more so as the probability of you approving the PR seemed so small. |
For all we know @ashald's time is even more limited than yours and they have already expressed the fact that they are not being supported as much as they need to be financially by the users of this plugin [myself included], couple that with the fact that this is OSS, it's par for the course imo for an OSS repo to sometimes feel abandoned. |
To be clear, I didn't mean to pick on anyone personally - apologies if that was an impression. What I'm saying is that when I see a person with exclusive background in e.g. Python commenting on the issue like this, I have no questions whatsoever as they simply may lack expertise in Java to contribute a fix. When I see a person with lots of repos in Java, I'd imagine nothing really stops them from trying to debug an issue on their own. Well, except the lack of time or real interest in that thing working. And I must be fair: I did have few contributions when people saw things broken and submitted a PR to fix them, but I'm wondering about that fuzzy state in which "it's annoying enough to comment on a ticket, but not annoying enough to contribute a fix despite having relevant expertise." |
FWIW, I pushed fixes into the develop branch. |
Glad to see things are still picking up steam here! I've gone ahead and added notices to my fork telling people to head back here. If you had installed one of my releases, and would like to go back, just uninstall, and reinstall directly from the plugin marketplace once it's available there. |
Lol, was just about to open a pull request with fixes for Idea and PyCharm... oh well, learned a lot about JetBrains plugins 😆 |
@mrworkman what did you plan to fix for IDEA? I was under impressions it works fine. |
OK, whatever, cut a new release https://github.com/ashald/EnvFile/releases/tag/v3.3.0 Going to submit it to JetBrains later tonight. Going to resolve this issue, but if you find any bugs etc - feel free to reopen or create a new issue. |
EnvFile didn't work for me in IntelliJ 2022.2.2 until I updated to a more recent SDK and updated the method signature. |
@mrworkman it doesn't work in my environment, |
same here: Intellij Idea |
same here. Is there any version/fork of envfile that is known to work in Pycharm 2022.2.3? |
@trondhindenes I guess we need to create a new issue with reference to this one to move people to reopen this isse. |
Just checked and works like a charm in PyCharm 2022.2.4 |
I got it working. The error was that I tried to use envfile with Pycharm's test runner, and that doesn't work. However regular run configurations do. 🤷 |
IntelliJ IDEA 2022.2.3 (Ultimate Edition) I have the same problem with Cucumber Java Run/Debug configuration. |
I am getting empty environment variables on Python projects even I set a value after IntelliJ Update
The text was updated successfully, but these errors were encountered: