-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
mpremote: Allow user configuration on Windows #9573
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
Conversation
43a896b
to
b774a7e
Compare
b774a7e
to
8a54028
Compare
dce2f76
to
0fbc081
Compare
ed59b5b
to
bf90175
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9573 +/- ##
=======================================
Coverage 98.38% 98.38%
=======================================
Files 171 171
Lines 22283 22283
=======================================
Hits 21924 21924
Misses 359 359 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
8630963
to
dcc0173
Compare
Code size report:
|
dcc0173
to
7f1c380
Compare
As this was not yet merged I made a change:
|
4226369
to
0ae37a4
Compare
micropython/micropython#9573 Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
0ae37a4
to
7d51239
Compare
b832e8b
to
8dabeb8
Compare
3185a00
to
db2a4bb
Compare
db2a4bb
to
3af2879
Compare
3af2879
to
b52cf9e
Compare
Rebased again to simplify a merge. |
b52cf9e
to
493b932
Compare
This has been in the Que for more than a few releases now, and I would like this functionality to work on my main Windows platform . I think the implementation could be much simplified , and made more consistent using this module. path = platformdirs.user_config_dir(appname=_PROG, appauthor=False)
config_file = os.path.join(path, "config.py") |
493b932
to
ea8fc9f
Compare
668a415
to
2988268
Compare
rebased and textual updates to commit messages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a really nice simplification and enhancement. I usually don't like dependencies, but in this case IMO it's worth it, platformdirs
brings in a lot of useful (and tricky) functionality.
Tested it locally (on Arch Linux) and it works well. Arch has a python-platformdirs
package (which I already had installed), and it continues to find my config in $(HOME)/.config/mpremote/config.py
.
Very good!
Needed to easily find the user configuration file. Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
Use `platformdirs.user_config_dir()` (see https://platformdirs.readthedocs.io/en/latest/api.html#user-config-directory) to provide portability across many different OSes and configuration styles. Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
2988268
to
a9dd741
Compare
Now merged. Sorry @Josverl this took so long to get through, but good that it's now much simpler with |
Simplifies the use of mpremote's user configuration on Windows, by also considering the Windows standard environment variable
APPDATA
, which is the OS default for storing any user/application related file-based configuration. ( changed from USERPROFILE)This avoids the need for a Windows user to set the
HOME
orXDG_CONFIG_HOME
environment variable, both of which are non-standard on Windows.Per Microsoft documentation:
However Windows users also are used to %USERPROFILE%, which was established as a location in a previous century.
in order to adhere to both recommended usage ( $XDG_CONFIG_HOME and %APPDATA%) as well as common user practices ($HOME and %USERPROFILE%) , all variables used in a scan for a valid configuration file, and this first config file is used.
Simply stated : newer standards are preferred over the older standards, and Linux environment variables take precidence.