-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Minor fixes and deprecations from #12771 #15062
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
Conversation
@@ -308,4 +308,4 @@ def print_result(args, prefix, result): | |||
actions["PIP"] = result["pip"] | |||
common.stdout_json_success(prefix=prefix, actions=actions) | |||
else: | |||
install.print_activate(args.name or prefix) | |||
common.print_activate(args.name or prefix) |
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.
Lines 158 to 162 in 08c7e5d
@deprecated("25.9", "26.3", addendum="Use conda.cli.common.print_activate()") | |
def print_activate(env_name_or_prefix): # pragma: no cover | |
from .common import print_activate as _print_activate | |
_print_activate(env_name_or_prefix) |
conda/gateways/logging.py
Outdated
@@ -208,7 +208,7 @@ def set_all_logger_level(level=DEBUG): | |||
@cache | |||
def set_file_logging(logger_name=None, level=DEBUG, path=None): | |||
if path is None: | |||
timestamp = datetime.utcnow().strftime("%Y%m%d-%H%M%S") | |||
timestamp = datetime.now(datetime.UTC).strftime("%Y%m%d-%H%M%S") |
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.
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.
timestamp = datetime.now(datetime.UTC).strftime("%Y%m%d-%H%M%S") | |
timestamp = datetime.now(timezone.utc).strftime("%Y%m%d-%H%M%S") |
datetime.UTC was only added in 3.11, but datetime.timezone.utc in Python 3.2. Let's use datetime.timezone.utc
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.
Done in 540fe2a
(#15062)
@@ -12,7 +12,8 @@ | |||
import pytest | |||
|
|||
from conda.common.path import get_python_site_packages_short_path | |||
from conda.common.pkg_formats.python import ( | |||
from conda.common.url import join_url | |||
from conda.plugins.prefix_data_loaders.pypi.pkg_format import ( |
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.
conda/conda/common/pkg_formats/python.py
Lines 42 to 46 in 08c7e5d
deprecated.module( | |
"25.9", | |
"26.3", | |
addendum="Use 'conda.plugins.prefix_data_loaders.pypi.pkg_format' hook instead", | |
) |
@@ -535,7 +536,7 @@ def test_noarch_python_package_with_entry_points( | |||
entry point script, "pygmentize". | |||
""" | |||
with tmp_env("pygments") as prefix: | |||
py_ver = get_python_version_for_prefix(prefix) | |||
py_ver = get_major_minor_version(PrefixData(prefix).get("python", None).version) |
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.
conda/conda/core/prefix_data.py
Lines 682 to 695 in 08c7e5d
@deprecated("25.9", "26.3", addendum="Use `PrefixData.get('python').version` instead.") | |
def get_python_version_for_prefix(prefix: os.PathLike) -> str | None: | |
""" | |
For the given conda prefix, return the version of the Python installation | |
in that prefix. | |
""" | |
# returns a string e.g. "2.7", "3.4", "3.5" or None | |
record = PrefixData(prefix).get("python", None) | |
if record is not None: | |
if record.version[3].isdigit(): | |
return record.version[:4] | |
else: | |
return record.version[:3] | |
return None |
@@ -114,7 +114,6 @@ def test_resume_download(tmp_path): | |||
responses.add( | |||
responses.GET, | |||
url_pattern, | |||
stream=True, |
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.
CodSpeed Instrumentation Performance ReportMerging #15062 will not alter performanceComparing Summary
|
* Mark `conda.gateways.disk.create.create_application_entry_point` as pending deprecation, to be removed in 26.9. (#15062) | ||
* Mark `conda.gateways.disk.create.ProgressFileWrapper` as pending deprecation, to be removed in 26.9. (#15062) | ||
* Mark `conda.gateways.disk.create.create_fake_executable_softlink` as pending deprecation, to be removed in 26.9. (#15062) | ||
* Postpone `conda.env.specs.binstar` deprecation to 26.9. (#15062) |
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.
👍🏻
conda/gateways/logging.py
Outdated
@@ -208,7 +208,7 @@ def set_all_logger_level(level=DEBUG): | |||
@cache | |||
def set_file_logging(logger_name=None, level=DEBUG, path=None): | |||
if path is None: | |||
timestamp = datetime.utcnow().strftime("%Y%m%d-%H%M%S") | |||
timestamp = datetime.now(datetime.UTC).strftime("%Y%m%d-%H%M%S") |
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.
timestamp = datetime.now(datetime.UTC).strftime("%Y%m%d-%H%M%S") | |
timestamp = datetime.now(timezone.utc).strftime("%Y%m%d-%H%M%S") |
datetime.UTC was only added in 3.11, but datetime.timezone.utc in Python 3.2. Let's use datetime.timezone.utc
Description
Extracted smaller fixes from #12771 in order to get them included in 25.7.0 release.
Checklist - did you ...
news
directory (using the template) for the next release's release notes?Add / update outdated documentation?