Skip to content

Commit c8db410

Browse files
Remove deprecated things and change defaults as announced in 2.114.0 (#1625)
Signed-off-by: Jean-Christophe Morin <[email protected]>
1 parent 2a9a99c commit c8db410

File tree

22 files changed

+162
-241
lines changed

22 files changed

+162
-241
lines changed

CHANGELOG.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,105 @@
22

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

5+
## 3.0.0 (TBD)
6+
[Source](https://github.com/AcademySoftwareFoundation/rez/tree/3.0.0) | [Diff](https://github.com/AcademySoftwareFoundation/rez/compare/2.114.1...3.0.0)
7+
8+
This release marks a big turning point for rez by completely dropping support for Python 2.
9+
In 2.114.0, it was still possible to install rez with Python 2 using pip. This functionality has
10+
now been removed. As of now, rez will support Python 3.7+. As of now, we test against 3.7, 3.8, 3.9,
11+
3.10 and 3.11.
12+
13+
This was a tough decision to make considering that we still have users relying on Python 2, but
14+
it was becoming more and more complicated and time-consuming to maintain support for Python 2.
15+
16+
Thank you to everyone who's put a lot of effort into supporting Python 2 for that long. Without
17+
you, it wouldn't have been possible.
18+
19+
As part of the effort to remove support for Python 2, we also refreshed our CI a bit:
20+
- The GitHub Action workflows are now simplified and unified. We now have one workflow to
21+
run all tests for all platforms instead of four.
22+
- We also got rid of the Windows containers. With these changes, our Windows tests are now
23+
as fast as Linux and macOS tests, it's easier to see test results and we can also more
24+
easily test all support python versions.
25+
- Running the tests directly on the GH hosted runners instead of containers,
26+
we discovered some big flaws in how our tests were set up. These issues are now
27+
fixed and our tests are now much more portable and don't rely on a centrally installed
28+
Python or `PATHEXT` to be set. Big thanks to [@Dennis-Lehmann](https://github.com/Dennis-Lehmann)
29+
and [@MrLixm](https://github.com/MrLixm) for helping us with debugging our Window tests!
30+
31+
The CI refresh is not user-facing, but it took us a significant amount of effort
32+
and time to do and we hope that it will help increase the quality of rez and make
33+
for a better contributor experience. This is why we mention these in the release notes.
34+
35+
### Features
36+
37+
- It is now possible to configure the execution policy used when starting PowerShell (and pwsh) shells
38+
by setting the `execution_policy` setting in the shell's config file. This should hopefully help to
39+
smooth the transition from the cmd shell to powershell/pwsh.[\#1505](https://github.com/AcademySoftwareFoundation/rez/pull/1505) ([@herronelou](https://github.com/herronelou))
40+
- 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))
41+
42+
### Fixes
43+
44+
- 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))
45+
46+
### Removed
47+
48+
As communicated in the 2.114.0 release notes, we've followed through on the removal of certain things.
49+
50+
- Python 2: It is now impossible to install and use rez with Python 2.
51+
52+
- Modules
53+
- `rez.vendor.version`: Use `rez.version` instead.
54+
- `rez.build_process_`: Use `rez.build_process` instead.
55+
- `rez.package_maker__`: Use `rez.package_maker` instead.
56+
- `rez.package_resources_`: Use `rez.package_resources` instead.
57+
- `rez.packages_`: Use `rez.packages` instead.
58+
59+
- Configuration settings
60+
- `rxt_as_yaml`: No replacement.
61+
- `warn_commands2`: No replacement. This was a no-op.
62+
- `error_commands2`: No replacement. This was a no-op.
63+
- `rez_1_cmake_variables`: You can use the `REZ_BUILD_TYPE` CMake variable instead of `CENTRAL`.
64+
65+
- CLI
66+
- rez-pip: The `--pip-version` is removed.
67+
- rez-search: The `--sort` is removed.
68+
69+
- API
70+
- The `isolate` keyword argument of the `rez.rex.RexExecutor.execute_code` method is now officially removed.
71+
Instead of `executor.execute_code(..., isolate=True)`, use
72+
```python
73+
with executor.reset_globals():
74+
executor.execute_code(...)
75+
```
76+
77+
- Build system:
78+
- `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))
79+
- 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))
80+
81+
### Changed
82+
83+
Change of default values as announced in 2.114.0:
84+
85+
- `rez_1_environment_variables`: Now disabled by default.
86+
- `disable_rez_1_compatibility`: Now enabled by default.
87+
88+
New unannounced changes:
89+
90+
- The default shell on Windows is now PowerShell unless you configure `default_shell`
91+
to a different value. The previous default was `cmd` and was causing a lot of problems.
92+
93+
### Docs
94+
95+
The effort to improve and add content to our docs continues.
96+
97+
* New documentation dedicated to [caching](https://rez.readthedocs.io/en/stable/caching.html).
98+
This is only the beginning and only contains information on package payload caching and
99+
memcached. We hope to add more content in the future. [\#1615](https://github.com/AcademySoftwareFoundation/rez/pull/1615) ([@brycegbrazen](https://github.com/brycegbrazen))
100+
- The note about SemVer in the [docs](https://rez.readthedocs.io/en/stable/basic_concepts.html#versions)
101+
has been clarified. While we encourage SemVer like versioning, rez doesn't know
102+
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))
103+
5104
## 2.114.1 (2023-12-09)
6105
[Source](https://github.com/AcademySoftwareFoundation/rez/tree/2.114.1) | [Diff](https://github.com/AcademySoftwareFoundation/rez/compare/2.114.0...2.114.1)
7106

docs/source/guides/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ This section contains various user guides.
77
.. toctree::
88
:maxdepth: 1
99

10-
prepare_for_3
10+
update_to_3

docs/source/guides/prepare_for_3.rst renamed to docs/source/guides/update_to_3.rst

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,37 @@
1-
=====================
2-
Prepare for rez 3.0.0
3-
=====================
1+
===================
2+
Update to rez 3.0.0
3+
===================
44

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

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

1211
Steps for smooth upgrade
1312
========================
1413

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

1918
#. Upgrade to ``2.114.0``.
2019

2120
To upgrade to (or before upgrading to) rez ``3.0.0``, we suggest that you first
22-
upgrade to ``2.114.0``. This is not mandatory and you can jump straight to ``3.0.0``
21+
upgrade to ``2.114.1``. This is not mandatory and you can jump straight to ``3.0.0``
2322
if you wish.
24-
23+
24+
You should prefer 2.114.1 over 2.114.0 because 2.114.0 contained a bug that prevented
25+
rez from correctly running when :envvar:`REZ_LOG_DEPRECATION_WARNINGS` is set.
26+
2527
.. warning::
26-
28+
2729
If you skip this step, you won't be able to see deprecation warnings before
28-
things are removed frm the rez code base.
30+
things are removed/changed from the rez code base.
2931

30-
#. Set the ``REZ_LOG_DEPRECATION_WARNINGS`` environment variable.
32+
#. Set the :envvar:`REZ_LOG_DEPRECATION_WARNINGS` environment variable.
3133

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

4042
#. Address each warning one by one.
4143

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

4546
Optional
4647
========
4748

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

5152
Detect old-style commands in your repositories
5253
----------------------------------------------

src/rez/__init__.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,3 @@ def callback(sig, frame):
7070
# This means we have to rely on a custom environment variable.
7171
if os.getenv("REZ_LOG_DEPRECATION_WARNINGS"):
7272
warnings.filterwarnings("default", category=rez.deprecations.RezDeprecationWarning)
73-
74-
75-
if sys.version_info[:2] < (3, 7):
76-
rez.deprecations.warn(
77-
"Support for Python less than 3.7 is deprecated and will be removed in rez 3.0.0.",
78-
rez.deprecations.RezDeprecationWarning,
79-
)

src/rez/build_process_.py

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/rez/cli/pip.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ def setup_parser(parser, completions=False):
1616
help="python version (rez package) to use, default is latest. Note "
1717
"that the pip package(s) will be installed with a dependency on "
1818
"python-MAJOR.MINOR.")
19-
parser.add_argument(
20-
"--pip-version", dest="pip_ver", metavar="VERSION",
21-
help="pip version (rez package) to use, default is latest."
22-
" This option is deprecated and will be removed in 3.0.0.")
2319
parser.add_argument(
2420
"-i", "--install", action="store_true",
2521
help="install the package")
@@ -49,21 +45,13 @@ def command(opts, parser, extra_arg_groups=None):
4945
logging.getLogger('rez').setLevel(logging.INFO)
5046

5147
from rez.pip import pip_install_package
52-
import rez.deprecations
5348

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

58-
if opts.pip_ver:
59-
rez.deprecations.warn(
60-
"The option --pip-version is deprecated and will be removed in 3.0.0",
61-
category=rez.deprecations.RezDeprecationWarning,
62-
)
63-
6453
pip_install_package(
6554
opts.PACKAGE,
66-
pip_version=opts.pip_ver,
6755
python_version=opts.py_ver,
6856
release=opts.release,
6957
prefix=opts.prefix,

src/rez/cli/search.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ def setup_parser(parser, completions=False):
5757
help="only show packages released after the given time. Supported "
5858
"formats are: epoch time (eg 1393014494), or relative time (eg -10s, "
5959
"-5m, -0.5h, -10d)")
60-
parser.add_argument(
61-
"-s", "--sort", action="store_true",
62-
help="print results in sorted order (deprecated)")
6360
PKG_action = parser.add_argument(
6461
"PKG", type=str, nargs='?',
6562
help="packages to search, glob-style patterns are supported")
@@ -73,20 +70,13 @@ def command(opts, parser, extra_arg_groups=None):
7370
from rez.package_search import ResourceSearcher, ResourceSearchResultFormatter
7471
from rez.utils.formatting import get_epoch_time_from_str
7572
from rez.config import config
76-
import rez.deprecations
7773

7874
before_time = get_epoch_time_from_str(opts.before)
7975
after_time = get_epoch_time_from_str(opts.after)
8076

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

84-
if opts.sort:
85-
rez.deprecations.warn(
86-
"the '--sort' argument is deprecated and will be removed in 3.0.0. It currently has no effect.",
87-
rez.deprecations.RezDeprecationWarning,
88-
)
89-
9080
if opts.no_warnings:
9181
config.override("warn_none", True)
9282

src/rez/config.py

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,6 @@ def _parse_env_var(self, value):
451451
"package_cache_max_variant_days": Int,
452452
"package_cache_clean_limit": Float,
453453
"allow_unversioned_packages": Bool,
454-
"rxt_as_yaml": Bool,
455454
"package_cache_during_build": Bool,
456455
"package_cache_local": Bool,
457456
"package_cache_same_device": Bool,
@@ -485,13 +484,12 @@ def _parse_env_var(self, value):
485484
"default_relocatable": Bool,
486485
"set_prompt": Bool,
487486
"prefix_prompt": Bool,
487+
# Note that if you want to remove a warn_* or debug_* config, you will
488+
# need to search for "config.warn(" or "config.debug(" to see if it's used.
488489
"warn_old_commands": Bool,
489490
"error_old_commands": Bool,
490491
"debug_old_commands": Bool,
491-
"warn_commands2": Bool,
492-
"error_commands2": Bool,
493492
"rez_1_environment_variables": Bool,
494-
"rez_1_cmake_variables": Bool,
495493
"disable_rez_1_compatibility": Bool,
496494
"make_package_temporarily_writable": Bool,
497495
"read_package_cache": Bool,
@@ -515,24 +513,10 @@ def _parse_env_var(self, value):
515513
# List of settings that are deprecated and should raise
516514
# deprecation warnings if referenced in config files.
517515
_deprecated_settings = {
518-
"rxt_as_yaml": _Deprecation("3.0.0"),
519516
"warn_old_commands": _Deprecation("the future"),
520517
"error_old_commands": _Deprecation("the future"),
521-
# Remove in 3.0 because it's currently a no-op
522-
"debug_old_commands": _Deprecation("3.0.0"),
523-
# Remove in 3.0 because it's currently a no-op
524-
"warn_commands2": _Deprecation("3.0.0"),
525-
# Remove in 3.0 because it's currently a no-op
526-
"error_commands2": _Deprecation("3.0.0"),
527-
"rez_1_environment_variables": _Deprecation(
528-
"the future",
529-
extra="Additionally, it will become disabled by default in 3.0.0.",
530-
),
531-
"rez_1_cmake_variables": _Deprecation("3.0.0"),
532-
"disable_rez_1_compatibility": _Deprecation(
533-
"the future",
534-
extra="Additionally, it will become enabled by default in 3.0.0.",
535-
)
518+
"rez_1_environment_variables": _Deprecation("the future"),
519+
"disable_rez_1_compatibility": _Deprecation("the future")
536520
}
537521

538522

src/rez/package_maker__.py

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/rez/package_resources_.py

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)