Skip to content

Commit

Permalink
Remove deprecated things and change defaults as announced in 2.114.0 (#…
Browse files Browse the repository at this point in the history
…1625)

Signed-off-by: Jean-Christophe Morin <jean_christophe_morin@hotmail.com>
  • Loading branch information
JeanChristopheMorinPerso committed Feb 8, 2024
1 parent 2a9a99c commit c8db410
Show file tree
Hide file tree
Showing 22 changed files with 162 additions and 241 deletions.
99 changes: 99 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,105 @@

<!-- start-here-sphinx-start-after -->

## 3.0.0 (TBD)
[Source](https://github.com/AcademySoftwareFoundation/rez/tree/3.0.0) | [Diff](https://github.com/AcademySoftwareFoundation/rez/compare/2.114.1...3.0.0)

This release marks a big turning point for rez by completely dropping support for Python 2.
In 2.114.0, it was still possible to install rez with Python 2 using pip. This functionality has
now been removed. As of now, rez will support Python 3.7+. As of now, we test against 3.7, 3.8, 3.9,
3.10 and 3.11.

This was a tough decision to make considering that we still have users relying on Python 2, but
it was becoming more and more complicated and time-consuming to maintain support for Python 2.

Thank you to everyone who's put a lot of effort into supporting Python 2 for that long. Without
you, it wouldn't have been possible.

As part of the effort to remove support for Python 2, we also refreshed our CI a bit:
- The GitHub Action workflows are now simplified and unified. We now have one workflow to
run all tests for all platforms instead of four.
- We also got rid of the Windows containers. With these changes, our Windows tests are now
as fast as Linux and macOS tests, it's easier to see test results and we can also more
easily test all support python versions.
- Running the tests directly on the GH hosted runners instead of containers,
we discovered some big flaws in how our tests were set up. These issues are now
fixed and our tests are now much more portable and don't rely on a centrally installed
Python or `PATHEXT` to be set. Big thanks to [@Dennis-Lehmann](https://github.com/Dennis-Lehmann)
and [@MrLixm](https://github.com/MrLixm) for helping us with debugging our Window tests!

The CI refresh is not user-facing, but it took us a significant amount of effort
and time to do and we hope that it will help increase the quality of rez and make
for a better contributor experience. This is why we mention these in the release notes.

### Features

- It is now possible to configure the execution policy used when starting PowerShell (and pwsh) shells
by setting the `execution_policy` setting in the shell's config file. This should hopefully help to
smooth the transition from the cmd shell to powershell/pwsh.[\#1505](https://github.com/AcademySoftwareFoundation/rez/pull/1505) ([@herronelou](https://github.com/herronelou))
- Built-in bind modules can now be overridden by adding your custom implementations to `bind_module_path`. [\#1557](https://github.com/AcademySoftwareFoundation/rez/pull/1557) ([@Pantsworth](https://github.com/Pantsworth))

### Fixes

- Fix infinite loop in the dot graph generation when `--fail-graph` is used and there are indirect cycles. [\#1620](https://github.com/AcademySoftwareFoundation/rez/pull/1620) ([@Pantsworth](https://github.com/Pantsworth))

### Removed

As communicated in the 2.114.0 release notes, we've followed through on the removal of certain things.

- Python 2: It is now impossible to install and use rez with Python 2.

- Modules
- `rez.vendor.version`: Use `rez.version` instead.
- `rez.build_process_`: Use `rez.build_process` instead.
- `rez.package_maker__`: Use `rez.package_maker` instead.
- `rez.package_resources_`: Use `rez.package_resources` instead.
- `rez.packages_`: Use `rez.packages` instead.

- Configuration settings
- `rxt_as_yaml`: No replacement.
- `warn_commands2`: No replacement. This was a no-op.
- `error_commands2`: No replacement. This was a no-op.
- `rez_1_cmake_variables`: You can use the `REZ_BUILD_TYPE` CMake variable instead of `CENTRAL`.

- CLI
- rez-pip: The `--pip-version` is removed.
- rez-search: The `--sort` is removed.

- API
- The `isolate` keyword argument of the `rez.rex.RexExecutor.execute_code` method is now officially removed.
Instead of `executor.execute_code(..., isolate=True)`, use
```python
with executor.reset_globals():
executor.execute_code(...)
```

- Build system:
- `CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT` and `_ECLIPSE_VERSION` were removed from the list of default variables passed to CMake. [\#1623](https://github.com/AcademySoftwareFoundation/rez/pull/1623) ([@JeanChristopheMorinPerso](https://github.com/JeanChristopheMorinPerso))
- rez will no longer print a custom error message if no build system is detected or set and an old "bez" `rezbuild.py` is detected. [\#1624](https://github.com/AcademySoftwareFoundation/rez/pull/1624) ([@JeanChristopheMorinPerso](https://github.com/JeanChristopheMorinPerso))

### Changed

Change of default values as announced in 2.114.0:

- `rez_1_environment_variables`: Now disabled by default.
- `disable_rez_1_compatibility`: Now enabled by default.

New unannounced changes:

- The default shell on Windows is now PowerShell unless you configure `default_shell`
to a different value. The previous default was `cmd` and was causing a lot of problems.

### Docs

The effort to improve and add content to our docs continues.

* New documentation dedicated to [caching](https://rez.readthedocs.io/en/stable/caching.html).
This is only the beginning and only contains information on package payload caching and
memcached. We hope to add more content in the future. [\#1615](https://github.com/AcademySoftwareFoundation/rez/pull/1615) ([@brycegbrazen](https://github.com/brycegbrazen))
- The note about SemVer in the [docs](https://rez.readthedocs.io/en/stable/basic_concepts.html#versions)
has been clarified. While we encourage SemVer like versioning, rez doesn't know
what SemVer is. This has been a source of confusion in the past. [\#1614](https://github.com/AcademySoftwareFoundation/rez/pull/1614) ([@brycegbrazen](https://github.com/brycegbrazen))

## 2.114.1 (2023-12-09)
[Source](https://github.com/AcademySoftwareFoundation/rez/tree/2.114.1) | [Diff](https://github.com/AcademySoftwareFoundation/rez/compare/2.114.0...2.114.1)

Expand Down
2 changes: 1 addition & 1 deletion docs/source/guides/index.rst
Expand Up @@ -7,4 +7,4 @@ This section contains various user guides.
.. toctree::
:maxdepth: 1

prepare_for_3
update_to_3
@@ -1,35 +1,37 @@
=====================
Prepare for rez 3.0.0
=====================
===================
Update to rez 3.0.0
===================

The rez TSC started to prepare to release rez ``3.0.0``. Rez ``3.0.0`` will not be
a major breaking change but will still remove some things.
Rez ``3.0.0`` is not be a major breaking change, except that Python 2 is not supported anymore.
There is various other small changes too.

This guide will show you how to prepare in advance before ``3.0.0`` is released so
that you are not caught by surprise by the changes made in ``3.0.0`` once you start
using ``3.0.0``. We hope that this guide will help make the upgrade process smoother.
This guide will show you how to prepare before upgrading to ``3.0.0``. We hope that this guide will
help make the upgrade process smoother.

Steps for smooth upgrade
========================

#. Read the `release notes <../CHANGELOG.html>`_ for ``2.114.0`` and ``3.0.0`` (once released). The release
notes will contain a list of everything that was deprecated in ``2.114.0`` and will
be removed or changed in ``3.0.0``.
#. Read the `release notes <../CHANGELOG.html>`_ for ``2.114.0`` and ``3.0.0``. The release
notes will contain a list of everything that was deprecated in ``2.114.0`` and removed or
changed in ``3.0.0``.

#. Upgrade to ``2.114.0``.

To upgrade to (or before upgrading to) rez ``3.0.0``, we suggest that you first
upgrade to ``2.114.0``. This is not mandatory and you can jump straight to ``3.0.0``
upgrade to ``2.114.1``. This is not mandatory and you can jump straight to ``3.0.0``
if you wish.


You should prefer 2.114.1 over 2.114.0 because 2.114.0 contained a bug that prevented
rez from correctly running when :envvar:`REZ_LOG_DEPRECATION_WARNINGS` is set.

.. warning::

If you skip this step, you won't be able to see deprecation warnings before
things are removed frm the rez code base.
things are removed/changed from the rez code base.

#. Set the ``REZ_LOG_DEPRECATION_WARNINGS`` environment variable.
#. Set the :envvar:`REZ_LOG_DEPRECATION_WARNINGS` environment variable.

``2.114.1`` adds a new environment variable called :envvar:`REZ_LOG_DEPRECATION_WARNINGS`
``2.114.0`` adds a new environment variable called :envvar:`REZ_LOG_DEPRECATION_WARNINGS`
that will force all rez related deprecation warnings to be printed out to stderr.
This will let you catch if you are using something deprecated that will be removed
in future versions.
Expand All @@ -39,14 +41,13 @@ Steps for smooth upgrade

#. Address each warning one by one.

#. Once you think you have addressed all warnings, upgrade to 3.0.0 (or wait for ``3.0.0`` to
be released if it's not yet available).
#. Once you think you have addressed all warnings, upgrade to 3.0.0.

Optional
========

Since some default configuration default values will change in ``3.0.0``, we highly suggest
that you run some anslysis scripts to see if you will be impacted by these changes.
that you run some analysis scripts to see if you will be impacted by these changes.

Detect old-style commands in your repositories
----------------------------------------------
Expand Down
7 changes: 0 additions & 7 deletions src/rez/__init__.py
Expand Up @@ -70,10 +70,3 @@ def callback(sig, frame):
# This means we have to rely on a custom environment variable.
if os.getenv("REZ_LOG_DEPRECATION_WARNINGS"):
warnings.filterwarnings("default", category=rez.deprecations.RezDeprecationWarning)


if sys.version_info[:2] < (3, 7):
rez.deprecations.warn(
"Support for Python less than 3.7 is deprecated and will be removed in rez 3.0.0.",
rez.deprecations.RezDeprecationWarning,
)
12 changes: 0 additions & 12 deletions src/rez/build_process_.py

This file was deleted.

12 changes: 0 additions & 12 deletions src/rez/cli/pip.py
Expand Up @@ -16,10 +16,6 @@ def setup_parser(parser, completions=False):
help="python version (rez package) to use, default is latest. Note "
"that the pip package(s) will be installed with a dependency on "
"python-MAJOR.MINOR.")
parser.add_argument(
"--pip-version", dest="pip_ver", metavar="VERSION",
help="pip version (rez package) to use, default is latest."
" This option is deprecated and will be removed in 3.0.0.")
parser.add_argument(
"-i", "--install", action="store_true",
help="install the package")
Expand Down Expand Up @@ -49,21 +45,13 @@ def command(opts, parser, extra_arg_groups=None):
logging.getLogger('rez').setLevel(logging.INFO)

from rez.pip import pip_install_package
import rez.deprecations

# a bit weird, but there used to be more options. Leave like this for now
if not opts.install:
parser.error("Expected one of: --install")

if opts.pip_ver:
rez.deprecations.warn(
"The option --pip-version is deprecated and will be removed in 3.0.0",
category=rez.deprecations.RezDeprecationWarning,
)

pip_install_package(
opts.PACKAGE,
pip_version=opts.pip_ver,
python_version=opts.py_ver,
release=opts.release,
prefix=opts.prefix,
Expand Down
10 changes: 0 additions & 10 deletions src/rez/cli/search.py
Expand Up @@ -57,9 +57,6 @@ def setup_parser(parser, completions=False):
help="only show packages released after the given time. Supported "
"formats are: epoch time (eg 1393014494), or relative time (eg -10s, "
"-5m, -0.5h, -10d)")
parser.add_argument(
"-s", "--sort", action="store_true",
help="print results in sorted order (deprecated)")
PKG_action = parser.add_argument(
"PKG", type=str, nargs='?',
help="packages to search, glob-style patterns are supported")
Expand All @@ -73,20 +70,13 @@ def command(opts, parser, extra_arg_groups=None):
from rez.package_search import ResourceSearcher, ResourceSearchResultFormatter
from rez.utils.formatting import get_epoch_time_from_str
from rez.config import config
import rez.deprecations

before_time = get_epoch_time_from_str(opts.before)
after_time = get_epoch_time_from_str(opts.after)

if after_time and before_time and (after_time >= before_time):
parser.error("non-overlapping --before and --after")

if opts.sort:
rez.deprecations.warn(
"the '--sort' argument is deprecated and will be removed in 3.0.0. It currently has no effect.",
rez.deprecations.RezDeprecationWarning,
)

if opts.no_warnings:
config.override("warn_none", True)

Expand Down
24 changes: 4 additions & 20 deletions src/rez/config.py
Expand Up @@ -451,7 +451,6 @@ def _parse_env_var(self, value):
"package_cache_max_variant_days": Int,
"package_cache_clean_limit": Float,
"allow_unversioned_packages": Bool,
"rxt_as_yaml": Bool,
"package_cache_during_build": Bool,
"package_cache_local": Bool,
"package_cache_same_device": Bool,
Expand Down Expand Up @@ -485,13 +484,12 @@ def _parse_env_var(self, value):
"default_relocatable": Bool,
"set_prompt": Bool,
"prefix_prompt": Bool,
# Note that if you want to remove a warn_* or debug_* config, you will
# need to search for "config.warn(" or "config.debug(" to see if it's used.
"warn_old_commands": Bool,
"error_old_commands": Bool,
"debug_old_commands": Bool,
"warn_commands2": Bool,
"error_commands2": Bool,
"rez_1_environment_variables": Bool,
"rez_1_cmake_variables": Bool,
"disable_rez_1_compatibility": Bool,
"make_package_temporarily_writable": Bool,
"read_package_cache": Bool,
Expand All @@ -515,24 +513,10 @@ def _parse_env_var(self, value):
# List of settings that are deprecated and should raise
# deprecation warnings if referenced in config files.
_deprecated_settings = {
"rxt_as_yaml": _Deprecation("3.0.0"),
"warn_old_commands": _Deprecation("the future"),
"error_old_commands": _Deprecation("the future"),
# Remove in 3.0 because it's currently a no-op
"debug_old_commands": _Deprecation("3.0.0"),
# Remove in 3.0 because it's currently a no-op
"warn_commands2": _Deprecation("3.0.0"),
# Remove in 3.0 because it's currently a no-op
"error_commands2": _Deprecation("3.0.0"),
"rez_1_environment_variables": _Deprecation(
"the future",
extra="Additionally, it will become disabled by default in 3.0.0.",
),
"rez_1_cmake_variables": _Deprecation("3.0.0"),
"disable_rez_1_compatibility": _Deprecation(
"the future",
extra="Additionally, it will become enabled by default in 3.0.0.",
)
"rez_1_environment_variables": _Deprecation("the future"),
"disable_rez_1_compatibility": _Deprecation("the future")
}


Expand Down
12 changes: 0 additions & 12 deletions src/rez/package_maker__.py

This file was deleted.

12 changes: 0 additions & 12 deletions src/rez/package_resources_.py

This file was deleted.

12 changes: 0 additions & 12 deletions src/rez/packages_.py

This file was deleted.

13 changes: 1 addition & 12 deletions src/rez/resolved_context.py
Expand Up @@ -42,7 +42,6 @@
from rez.utils import json
from rez.utils.yaml import dump_yaml
from rez.utils.platform_ import platform_
import rez.deprecations

from contextlib import contextmanager
from functools import wraps
Expand Down Expand Up @@ -655,17 +654,7 @@ def write_to_buffer(self, buf):
"""Save the context to a buffer."""
doc = self.to_dict()

if config.rxt_as_yaml:
rez.deprecations.warn(
"Writing the RXT file using the YAML format is deprecated. "
"Both this functionality and the rxt_as_yaml setting will "
"be removed in rez 3.0.0",
rez.deprecations.RezDeprecationWarning,
)
content = dump_yaml(doc)
else:
content = json.dumps(doc, indent=4, separators=(",", ": "),
sort_keys=True)
content = json.dumps(doc, indent=4, separators=(",", ": "), sort_keys=True)

buf.write(content)

Expand Down

0 comments on commit c8db410

Please sign in to comment.