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

Support multiple path characteristics for switch_page and page_link #8127

Merged
merged 1 commit into from Feb 9, 2024

Conversation

kmcgrady
Copy link
Collaborator

@kmcgrady kmcgrady commented Feb 9, 2024

Describe your changes

The changes made improve page path calculation, but don't support file path scenarios with .., etc. This change aims to clean up the logic and ensure it's consistent.

Testing Plan

  • Unit Tests - Tested the file path methods to cover all the use cases
  • Manual Testing - Testing on Windows and Mac

Contribution License Agreement

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.

@kmcgrady kmcgrady force-pushed the fix/page-path branch 2 times, most recently from 8eff09c to 71a29e4 Compare February 9, 2024 06:25
Comment on lines 226 to 227
main_script_path = os.path.join(os.getcwd(), main_script)
main_script_path = os.path.normpath(main_script_path)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
main_script_path = os.path.join(os.getcwd(), main_script)
main_script_path = os.path.normpath(main_script_path)
main_script_path = normalize_path_join(os.getcwd(), main_script)

Is there any reason not to reuse normalize_path_join in get_main_script_directory
I think we could replace these two lines with the normalize_path_join function call

@kmcgrady kmcgrady merged commit 086639c into develop Feb 9, 2024
47 of 50 checks passed
@kmcgrady kmcgrady deleted the fix/page-path branch February 9, 2024 21:04
kmcgrady added a commit that referenced this pull request Feb 9, 2024
…8127)

## Describe your changes

The changes made improve page path calculation, but don't support file
path scenarios with `..`, etc. This change aims to clean up the logic
and ensure it's consistent.

## Testing Plan

- Unit Tests - Tested the file path methods to cover all the use cases
- Manual Testing - Testing on Windows and Mac

---

**Contribution License Agreement**

By submitting this pull request you agree that all contributions to this
project are made under the Apache 2.0 license.
zyxue pushed a commit to zyxue/streamlit that referenced this pull request Apr 16, 2024
…treamlit#8127)

## Describe your changes

The changes made improve page path calculation, but don't support file
path scenarios with `..`, etc. This change aims to clean up the logic
and ensure it's consistent.

## Testing Plan

- Unit Tests - Tested the file path methods to cover all the use cases
- Manual Testing - Testing on Windows and Mac

---

**Contribution License Agreement**

By submitting this pull request you agree that all contributions to this
project are made under the Apache 2.0 license.
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.

None yet

2 participants