Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
Josverl wants to merge3 commits intomicropython:master
base:master
Choose a base branch
Loading
fromJosverl:mpremote-win-config

Conversation

Josverl
Copy link
Contributor

@JosverlJosverl commentedOct 11, 2022
edited
Loading

Simplifies the use of mpremote's user configuration on Windows, by also considering the Windows standard environment variableAPPDATA, 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 theHOME orXDG_CONFIG_HOME environment variable, both of which are non-standard on Windows.

Per Microsoft documentation:

The recommended location for a Windows application to store user settings is in the %APPDATA% folder. This folder is a hidden folder in the user's profile directory that is designed to store application-specific data, including user settings.

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.

#ENV_VARenv_valuePath_checkedplatform.system()
1XDG_CONFIG_HOME$HOME/.config/home/foo/.config/mpremoteLinux, Windows(MSYS32), Darwin
2HOME/home/boo/home/foo/.config/mpremoteLinux, Windows(MSYS32), Darwin
3APPDATAC:\Users\foo\AppData\RoamingC:\Users\foo\AppData\Roaming\mpremoteWindows
4USERPROFILEC:\Users\fooC:\Users\foo\mpremoteWindows

@JosverlJosverl marked this pull request as ready for reviewOctober 11, 2022 08:03
@JosverlJosverlforce-pushed thempremote-win-config branch 3 times, most recently fromdce2f76 to0fbc081CompareOctober 11, 2022 11:26
@dpgeorgedpgeorge added the toolsRelates to tools/ directory in source, or other tooling labelOct 25, 2022
@JosverlJosverlforce-pushed thempremote-win-config branch 4 times, most recently fromed59b5b tobf90175CompareNovember 5, 2022 20:52
@codecov-commenter
Copy link

codecov-commenter commentedNov 5, 2022
edited by codecovbot
Loading

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.54%. Comparing base(ef8282c) to head(ea8fc9f).
Report is 64 commits behind head on master.

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.
📢 Have feedback on the report?Share it here.

🚀 New features to boost your workflow:
  • ❄️Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link

github-actionsbot commentedMar 11, 2023
edited
Loading

Code size report:

   bare-arm:    +0 +0.000% minimal x86:    +0 +0.000%    unix x64:    +0 +0.000% standard      stm32:    +0 +0.000% PYBV10     mimxrt:    +0 +0.000% TEENSY40        rp2:    +0 +0.000% RPI_PICO_W       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS  qemu rv32:    +0 +0.000% VIRT_RV32

@Josverl
Copy link
ContributorAuthor

As this was not yet merged I made a change:

  • For *nix / Mac - leave the original logic and behaviour
  • for Windows : use %APPDATA%/mpremote/config.py
Wind-stormger reacted with thumbs up emoji

@JosverlJosverlforce-pushed thempremote-win-config branch 2 times, most recently from4226369 to0ae37a4CompareMarch 11, 2023 22:39
Josverl added a commit to Josverl/mpremote that referenced this pull requestMar 12, 2023
micropython/micropython#9573Signed-off-by: Jos Verlinde <Jos_Verlinde@hotmail.com>
@JosverlJosverlforce-pushed thempremote-win-config branch 2 times, most recently fromb832e8b to8dabeb8CompareJuly 19, 2023 20:16
@JosverlJosverlforce-pushed thempremote-win-config branch 3 times, most recently from3185a00 todb2a4bbCompareAugust 2, 2023 07:59
@JosverlJosverl requested a review fromdpgeorgeAugust 22, 2023 20:48
@Josverl
Copy link
ContributorAuthor

Rebased again to simplify a merge.
Apparent Errors in CI/CD seem to be grounded into errors thrown by untouched parts the repo

@Josverl
Copy link
ContributorAuthor

Josverl commentedApr 10, 2025
edited
Loading

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 .
However since the original PR I have have been using theplatformdirs module in some of my own tooling to solve the question on where to store what across platforms.

I think the implementation could be much simplified , and made more consistent using this module.
But it will add an additional dependency. Is that something that can be accepted , or steered away from ?
Update:
I have heard no objections, So I went ahead and was able to update the code to just 2 lines, that could be folded into one:

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>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@dpgeorgedpgeorgeAwaiting requested review from dpgeorge

@stinosstinosAwaiting requested review from stinos

Assignees
No one assigned
Labels
toolsRelates to tools/ directory in source, or other tooling
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@Josverl@codecov-commenter@stinos@dpgeorge

[8]ページ先頭

©2009-2025 Movatter.jp