Skip to content

DOC: document runtime environment variables in a dedicated page#17932

Merged
pllim merged 1 commit intoastropy:mainfrom
neutrinoceros:doc/env_vars
Apr 14, 2025
Merged

DOC: document runtime environment variables in a dedicated page#17932
pllim merged 1 commit intoastropy:mainfrom
neutrinoceros:doc/env_vars

Conversation

@neutrinoceros
Copy link
Contributor

Description

This is split from #17640 at @eerovaher's request.

  • By checking this box, the PR author has requested that maintainers do NOT use the "Squash and Merge" button. Maintainers should respect this when possible; however, the final decision is at the discretion of the maintainer that merges the PR.

@github-actions
Copy link
Contributor

Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.

  • Do the proposed changes actually accomplish desired goals?
  • Do the proposed changes follow the Astropy coding guidelines?
  • Are tests added/updated as required? If so, do they follow the Astropy testing guidelines?
  • Are docs added/updated as required? If so, do they follow the Astropy documentation guidelines?
  • Is rebase and/or squash necessary? If so, please provide the author with appropriate instructions. Also see instructions for rebase and squash.
  • Did the CI pass? If no, are the failures related? If you need to run daily and weekly cron jobs as part of the PR, please apply the "Extra CI" label. Codestyle issues can be fixed by the bot.
  • Is a change log needed? If yes, did the change log check pass? If no, add the "no-changelog-entry-needed" label. If this is a manual backport, use the "skip-changelog-checks" label unless special changelog handling is necessary.
  • Is this a big PR that makes a "What's new?" entry worthwhile and if so, is (1) a "what's new" entry included in this PR and (2) the "whatsnew-needed" label applied?
  • At the time of adding the milestone, if the milestone set requires a backport to release branch(es), apply the appropriate "backport-X.Y.x" label(s) before merge.

@github-actions
Copy link
Contributor

👋 Thank you for your draft pull request! Do you know that you can use [ci skip] or [skip ci] in your commit messages to skip running continuous integration tests until you are ready?

Comment on lines +343 to +345
Furthermore, it is possible to change the location of the cache directory
for the duration of the test run by setting the ``XDG_CACHE_HOME``
environment variable.
for the duration of the test run via environment variables, see
:ref:`environment_variables`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not how it works.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not 100% I'm following. This section is about the test runner. Are you hinting at how conftest.py obliterates user-set XDG_CACHE_HOME values ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section is about the test runner.

Irrelevant.

Are you hinting at how conftest.py obliterates user-set XDG_CACHE_HOME values ?

Yes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me rephrase: this section is providing insight on how to use the test runner downstream. In this context, our conftest.py files are not used.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The paragraph is indeed true. I really should have known better because I am the author of the commit that (unintentionally) made our test runner behave like that: 433a534

.. note::
``XDG_CONFIG_HOME`` and ``XDG_CACHE_HOME`` come from a Linux-centric
specification
(see `here <https://wiki.archlinux.org/index.php/XDG_Base_Directory_support>`_
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the link pointing to ArchWiki instead of the actual specification?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your guess is as good as mine.
my two cents: I think it's nice to point to a summary instead, especially when the actual specification is one obvious click away.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is always better to refer to the original source. Besides, it's a short specification.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel it's out of scope to change it here. Can we please postpone this ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

The ``astropy`` cache is stored in a centralized place (on Linux machines by
default it is ``$HOME/.astropy/cache``; see :ref:`astropy_config` for
more details). You can check its location on your machine::
The ``astropy`` cache is stored in a centralized place (see :ref:`astropy_config`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should the cache documentation point to config documentation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because cache location is configurable ? in any case, this is not from this PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cache location is not configurable using astropy configuration items.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, not from this PR. I'm already creating potentially massive merge conflicts for myself to handle once we finally circle back to #17640, I would really like for this to stay on topic.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On current main this documentation has to refer to the config documentation because that's where the XDG_CACHE_HOME environment variable is described. If this pull request creates a separate documentation page for the environment variables then there's no reason for the paragraph here to refer to config documentation anymore.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair enough

Comment on lines +29 to +32
.. note::
``XDG_CONFIG_HOME`` and ``XDG_CACHE_HOME`` come from a Linux-centric
specification
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should emphasize that astropy has only adopted the names of these two environment variables from the specification and nothing else.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the spec is specifically about UNIX-based systems though. I don't think it's a good idea to leave Windows users in the dark, especially because we do support them, so I don't agree with this take.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The updated descriptions in the glossary are clear enough so that this note doesn't have to be edited.

@neutrinoceros neutrinoceros marked this pull request as ready for review March 26, 2025 11:10
Copy link
Contributor

@mhvk mhvk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I like also that now we will have a good place to discuss other environment variables as well (like for building the system libraries). Would agree to keep this PR to just mostly moving the text around.

p.s. I do think it was helpful to see these changes on their own.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't announce documentation changes in the change log.

@pllim
Copy link
Member

pllim commented Apr 3, 2025

Thanks for this PR and the other one. Also the one Eero opened about testing doc. They are on my plate but I probably cannot get to them until next week. Thanks for your patience!

Copy link
Member

@pllim pllim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! It is good to finally have a dedicated section for this.

As for the links and contents, they were written a long time ago. The original motivation is now lost of buried in some really old commit/PR convo. I agree that updating them is out of scope here.

@pllim pllim merged commit 0318e2e into astropy:main Apr 14, 2025
32 of 33 checks passed
@neutrinoceros neutrinoceros deleted the doc/env_vars branch April 15, 2025 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants