-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Performance minded with some bug fixes #6311
base: main
Are you sure you want to change the base?
Conversation
e70596f
to
5b7f839
Compare
@@ -257,12 +257,6 @@ def python(self) -> str: | |||
|
|||
@cached_property | |||
def sys_path(self) -> list[str]: | |||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We made a terrible mistake in the python community remove docstrings in favor of annotations.
At list leave us with "The system path inside the environment" so we know that attribute is.
Also, if something is a list, one can consider calling it "sys_paths".
@@ -689,27 +750,6 @@ def _parse_pipfile( | |||
# Fallback to toml parser, for large files. | |||
return toml.loads(contents) | |||
|
|||
def _read_pyproject(self) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure why this was introduced, but is it OK to simply remove it?
def _release_file_lock(self, file_obj): | ||
"""Release lock on an existing file object""" | ||
if sys.platform == "win32": | ||
import msvcrt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This import block is repeated in _acquire_file_lock and in _relase lock. Consider moving to the top.
packages = { | ||
k: v | ||
for k, v in self.parsed_pipfile.get(section, {}).items() | ||
if is_vcs(v) or is_vcs(k) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How are VCS packages handeled now?
The issue
Testing against the sentry requirements file profiling from a fresh virtualenv creation with no Pipfile/Pipfile.lock: https://raw.githubusercontent.com/getsentry/sentry/refs/heads/master/requirements-base.txt
Main branch:
This branch:
The fix
The checklist
news/
directory to describe this fix with the extension.bugfix.rst
,.feature.rst
,.behavior.rst
,.doc.rst
..vendor.rst
. or.trivial.rst
(this will appear in the release changelog). Use semantic line breaks and name the file after the issue number or the PR #.