Skip to content
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

Use xdg #11108

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Use xdg #11108

wants to merge 5 commits into from

Conversation

dradetsky
Copy link
Contributor

@dradetsky dradetsky commented Dec 7, 2024

Resolves #2515

Problem

We hardcode the profile dir to ~/.dbt instead of using xdg.

On a related note, there was a circular dep issue that caused us to have to copypaste default_profiles_dir() instead of just importing it (which is annoying if we want to add more complexity to it), so we have to fix that.

Solution

Import & use appdirs.

Considerations

Per #2515, this has different effects on different platforms. I'm only thinking about it in terms of Linux, but maybe we don't want to use this on win/macos. Somebody else more familiar with those should comment.

Checklist

  • I have read the contributing guide and understand what's expected of me.
  • I have run this code in development, and it appears to resolve the stated issue.
  • This PR includes tests, or tests are not required or relevant for this PR.
  • This PR has no interface changes (e.g., macros, CLI, logs, JSON artifacts, config files, adapter interface, etc.) or this PR has already received feedback and approval from Product or DX.
  • This PR includes type annotations for new and modified functions.

@dradetsky dradetsky requested a review from a team as a code owner December 7, 2024 23:33
Copy link

cla-bot bot commented Dec 7, 2024

Thanks for your pull request, and welcome to our community! We require contributors to sign our Contributor License Agreement and we don't seem to have your signature on file. Check out this article for more information on why we have a CLA.

In order for us to review and merge your code, please submit the Individual Contributor License Agreement form attached above above. If you have questions about the CLA, or if you believe you've received this message in error, please reach out through a comment on this PR.

CLA has not been signed by users: @dradetsky

Copy link
Contributor

github-actions bot commented Dec 7, 2024

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

@github-actions github-actions bot added the community This PR is from a community member label Dec 7, 2024
@dradetsky
Copy link
Contributor Author

Fun Fact: pre-commit didn't work for me locally; most things were fine, but flake8 broke with

AttributeError: 'EntryPoints' object has no attribute 'get'

Looking into this error, the flake8 team just replies "use the new version". The project uses 4.0.1, and flake8 is on 7.1.1. It might be time to upgrade.

Additional Consideration: do we need to auto-migrate configs from ~/.dbt to ~/.config/dbt?

@dradetsky
Copy link
Contributor Author

@cla-bot check

@cla-bot cla-bot bot added the cla:yes label Dec 7, 2024
Copy link

cla-bot bot commented Dec 7, 2024

The cla-bot has been summoned, and re-checked this pull request!

@dradetsky
Copy link
Contributor Author

Whether this needs tests seems like something Product/DX can answer while they're approving it (or I guess rejecting it) so I'm ignoring that for the moment.

@dbeatty10
Copy link
Contributor

@dradetsky re-assessing this as a feature request beginning here: #2515 (comment)

@dradetsky dradetsky mentioned this pull request Dec 11, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:yes community This PR is from a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] On Linux: respect XDG_CONFIG_HOME and don't store config in user's home directory
2 participants