-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
base: master
Are you sure you want to change the base?
Conversation
43a896b
to
b774a7e
Compare
b774a7e
to
8a54028
Compare
dce2f76
to
0fbc081
Compare
ed59b5b
to
bf90175
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #9573 +/- ##
=======================================
Coverage 98.54% 98.54%
=======================================
Files 169 169
Lines 21890 21890
=======================================
+ Hits 21571 21572 +1
+ Misses 319 318 -1 ☔ 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") |
Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
Use [platformdirs.user_config_dir()](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>
493b932
to
ea8fc9f
Compare
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.