-
Notifications
You must be signed in to change notification settings - Fork 382
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
Added references to alternative POSIX shells, as well as pyenv to CONTRIBUTING.md #791
Open
ChloeZamorano
wants to merge
6
commits into
TagStudioDev:main
Choose a base branch
from
ChloeZamorano:minor-docs-addition
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Added references to alternative POSIX shells, as well as pyenv to CONTRIBUTING.md #791
ChloeZamorano
wants to merge
6
commits into
TagStudioDev:main
from
ChloeZamorano:minor-docs-addition
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit was made in order to account for users who may already have a Python installation that isn't 3.12. A good real world scenario where this may be a problem is users running on rolling release Linux distributions, such as Arch Linux which provides bleeding edge updates in a weekly basis. Continuing with Arch Linux as an example, it provides Python 3.13, which the current version of TagStudio doesn't seem to work with, an issue I encountered myself this morning. In some systems like Windows, this may not matter, but it is an issue nonetheless, and users using a package manager centric system can't be expected to downgrade/upgrade their Python version for TagStudio, as this may cause issues in their system. The easiest way to solve this is with pyenv, which enables users to install other Python versions independent from each other, aside from the system install, and allows specifying a version to use for a directory (And its subdirectories), the current terminal session, or the entire system if desired. Here is a short, technical and objective summary of the changes: - Updated `.gitignore` to to ignore `.python-version` which pyenv uses. - Updated CONTRIBUTING.md to refer to pyenv for versioning issues. - pyenv is listed as a prerequisite, specifying in parenthesis that it's only for when your Python install isn't 3.12. - The "Creating a Python Virtual Environment" section now has an additional step at the beginning, to check that the current Python installation is 3.12. - As part of this added step, there are steps to use pyenv to install Python 3.12 separately from the existing Python installation, and activate it for the TagStudio root folder, in case it's not the appropriate version. - The numbering of the other steps was offset accordingly. - The "Manually Launching (Outside of an IDE)" section now refers to the above first step, should the user encounter some kind of error.
Some users may not be using the default shell for their system, and Linux users are the most likely to do this, though this can be seen in macOS as well. People will often use shells like fish which is not POSIX compliant but works very well and has great auto-completion, it's very user friendly. The reason why I care about this is that the instructions specify to use .venv/bin/activate which is a bash script and will not run on fish or csh, and if you take a look at the script, indeed it says it will only run with bash. Python will provide alternate scripts for other shells, and at least on my system (CachyOS), those are scripts for Powershell, bash, fish and csh. People using these alternate shells, who don't know this may be confused when running the script referenced in CONTRIBUTING.md and seeing it fail completely. The only real change in this commit was adding under the "Linux/macOS" command in step 3 (step 2 prior to my last commit) of the "Creating a Python Virtual Environment" section, a short instruction to switch to the default shell, or use the appropriate script for the user's preferred shell if any (Since, at least on my system, there aren't scripts for every shell, for example there is no activate.zsh file).
Set the Qt.Dialog flag for modal windows, such as "Add Field" so that they will be seen as dialogs in the backend. This change is unlikely to be at all noticeable in systems like Windows, but for users running tiling window managers like bspwm or Sway, this will prevent these modal windows from being tiled alongside the main window, instead they will be floating on top, which is the expected behaviour seen on floating window managers, like the ones used by Windows and macOS. Added self.setWindowFlag(Qt.Dialog, on=True) # type: ignore to the following files: - tagstudio/src/qt/modals/add_field.py - tagstudio/src/qt/modals/delete_unlinked.py - tagstudio/src/qt/modals/drop_import.py - tagstudio/src/qt/modals/file_extension.py - tagstudio/src/qt/modals/fix_dupes.py - tagstudio/src/qt/modals/fix_unlinked.py - tagstudio/src/qt/modals/folders_to_tags.py - tagstudio/src/qt/modals/mirror_entities.py - tagstudio/src/qt/widgets/paged_panel/paged_panel.py - tagstudio/src/qt/widgets/panel.py - tagstudio/src/qt/widgets/progress.py Note that without adding # type: ignore, MyPy *will* give out an error, presumably because PySide6 is missing type hints for several things, and this may *or* may not be a justifiable use of # type: ignore, which throws the MyPy type checking for that line out the window. Ref: TagStudioDev#392, TagStudioDev#464
This commit changes CONTRIBUTING.md to refer to pyenv in the case of issues with Python versions, as well as downloading the correct version off of the Python website alternatively. It also now elaborates on the process of running the Python virtual environment on Linux and macOS, by referencing activation scripts for alternative shells such as fish and CSH. The table added to CONTRIBUTING.md is taken from the official Python documentation: https://docs.python.org/3.12/library/venv.html
CyanVoxel
added
Type: Bug
Something isn't working as intended
Type: Documentation
Additions/changes to documentation
Type: QoL
A quality of life (QoL) enhancement or suggestion
Type: UI/UX
User interface and/or user experience
Priority: Medium
An issue that shouldn't be be saved for last
Status: Review Needed
A review of this is needed
labels
Feb 5, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Priority: Medium
An issue that shouldn't be be saved for last
Status: Review Needed
A review of this is needed
Type: Bug
Something isn't working as intended
Type: Documentation
Additions/changes to documentation
Type: QoL
A quality of life (QoL) enhancement or suggestion
Type: UI/UX
User interface and/or user experience
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Now
CONTRIBUTING.md
is gonna be helpful for when a user encounters problems with non-matching Python version (Which is a problem Arch Linux users specifically are sure to encounter for example), as it now references the official Python website to download the correct version, but also pyenv as viable solutions.CONTRIBUTING.md
also now elaborates on running the Python virtual environment on Linux and macOS, by providing a handy table of shells/scripts supported by Python's virtual environment system, taken directly from their documentation.The
.gitignore
file now also includes the.python-version
file which is generated by pyenv to keep track of the version selected for the current folder, and should not be pushed to the remote repository.