Skip to content

Read config from ${CWD}/.streamlit/config.toml#227

Merged
tconkling merged 10 commits intostreamlit:developfrom
tconkling:tim/ReadConfigFromCWD
Oct 8, 2019
Merged

Read config from ${CWD}/.streamlit/config.toml#227
tconkling merged 10 commits intostreamlit:developfrom
tconkling:tim/ReadConfigFromCWD

Conversation

@tconkling
Copy link
Copy Markdown
Contributor

If a project has a config.toml at ${cwd}/.streamlit/config.toml, it's merged with the global config.toml (with the local config taking precedence for any options that are defined twice).

This also makes some minor API changes:

  • util.get_streamlit_file_path no longer intermediate directories for the file. Instead, the few places that need to ensure those directories exist call os.makedirs when appropriate.
  • config.parse_config_file no longer takes an optional file_contents param. This was only used for tests; the tests now properly patch the os.open os.path.exists and os.makedirs calls.

Fixes #221

@tconkling tconkling requested review from monchier and tvst October 1, 2019 23:17
Copy link
Copy Markdown
Contributor

@jrhone jrhone left a comment

Choose a reason for hiding this comment

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

Think it looks good with the suggested change

Copy link
Copy Markdown
Contributor

@tvst tvst left a comment

Choose a reason for hiding this comment

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

Approved after changes

"""Return the full path to a filepath in ~/.streamlit.
"""Return the full path to a file in ~/.streamlit.

Creates ~/.streamlit if needed.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since this PR removes this (which I think is the right thing to do), please try deleting config.toml and credentials.toml and then running Streamlit to see if anything breaks.

The missing credentials.toml should cause Streamlit to ask for the user's email, and then create the credentials file.

The missing config.toml should not make any difference. Streamlist should just work.

* develop:
  Support cli parameters (streamlit#186)
  Update README.md
  Update README.md (streamlit#282)
  Bug fix: make Streamlit watch files in subfolders again (streamlit#265)
  fix st.code("") (streamlit#272)
  different jslint commands for circleci and not (streamlit#273)
  Batch updates to report elements in the App state (streamlit#194)
  Minor typo in pull_request_template.md (streamlit#262)
  Fix wrong quote used in the provided sample code (streamlit#267)
  Fix websocket port handling (streamlit#263)
  Closing sidebar when clicking outside (streamlit#223)
  Version 0.47.2 (streamlit#212)
  [docs] Changed value in Show progress section of docs/getting_started.md to fix error (Issue streamlit#234) (streamlit#235)
  Update README.md
  Remove checkbox from CLA in PR Template
  Update README.md
  Update README.md
  mapping_demo: catch urllib errors (streamlit#224)
@tconkling tconkling merged commit d32ecf4 into streamlit:develop Oct 8, 2019
@tconkling tconkling deleted the tim/ReadConfigFromCWD branch October 8, 2019 15:30
tconkling added a commit to tconkling/streamlit that referenced this pull request Oct 8, 2019
* develop:
  Read config from ${CWD}/.streamlit/config.toml (streamlit#227)
  Fix unsafe_allow_html (streamlit#259)
  Support cli parameters (streamlit#186)
  Update README.md
  Update README.md (streamlit#282)
  Bug fix: make Streamlit watch files in subfolders again (streamlit#265)
  fix st.code("") (streamlit#272)
  different jslint commands for circleci and not (streamlit#273)
  Batch updates to report elements in the App state (streamlit#194)
  Minor typo in pull_request_template.md (streamlit#262)
  Fix wrong quote used in the provided sample code (streamlit#267)
  Fix websocket port handling (streamlit#263)
  Closing sidebar when clicking outside (streamlit#223)
  Version 0.47.2 (streamlit#212)
  [docs] Changed value in Show progress section of docs/getting_started.md to fix error (Issue streamlit#234) (streamlit#235)
  Update README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Read config from $CWD

3 participants