Skip to content

Commit

Permalink
Merge branch 'AcademySoftwareFoundation:main' into convert_rezconfig_…
Browse files Browse the repository at this point in the history
…to_rezconfigpy
  • Loading branch information
brycegbrazen authored Apr 2, 2024
2 parents f8df2e6 + d5c8643 commit c6658da
Show file tree
Hide file tree
Showing 24 changed files with 715 additions and 174 deletions.
3 changes: 3 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ Brendan Abel <007brendan@gmail.com> <babel@ssla.local>
Brendan Abel <007brendan@gmail.com> <brendan.abel@saatchi.com>
Brendan Abel <007brendan@gmail.com> <brendan.p.abel@disney.com>

Bryce Gattis <36783788+BryceGattis@users.noreply.github.com>
Bryce Gattis <36783788+BryceGattis@users.noreply.github.com> <69012021+brycegbrazen@users.noreply.github.com>

David Lai <davidlatwe@gmail.com> davidlatwe <davidlatwe@gmail.com>

Fabio Piparo <fabiop@themill.com> <fpiparo2@gfxuk057.london.methodstudios.com>
Expand Down
3 changes: 3 additions & 0 deletions .sonarcloud.properties
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ sonar.projectName=rez
# Source properties
sonar.sources=src
sonar.exclusions=src/build_utils/**,src/rez/data/**,src/rez/tests/**,src/rez/vendor/**

# Misc properties
sonar.python.version=3.7, 3.8, 3.9, 3.10, 3.11, 3.12
23 changes: 11 additions & 12 deletions ASWF/ONBOARDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ https://github.com/AcademySoftwareFoundation/asfw-sample-project/blob/main/tsc/p

Misc stuff not covered in the ASWF list

- [ ] Move from master to main branch [#1203](/../../issues/1203)
- [ ] Remove hardcoded references to `nerdvegas` where possible (some of these won't make sense to do until after gh migration) [#1205](/../../issues/1205)
- [X] Move from master to main branch [#1203](/../../issues/1203)
- [X] Remove hardcoded references to `nerdvegas` where possible (some of these won't make sense to do until after gh migration) [#1205](/../../issues/1205)
- TODO: inline links in comments (will need a script to batch convert)
- TODO: README.md
- [ ] Update Github slack integration [#1204](/../../issues/1204)
- [X] Update Github slack integration [#1204](/../../issues/1204)

# ASWF Onboarding Checklist
- Existing Project Governance
Expand All @@ -25,11 +25,10 @@ Misc stuff not covered in the ASWF list
- [X] A [CODE_OF_CONDUCT.md](../CODE_OF_CONDUCT.md) file that sets the ground rules for participants’ behavior associated and helps to facilitate a friendly, welcoming environment. By default, projects should leverage the Linux Foundation Code of Conduct unless an alternate Code of Conduct was previously approved. [#1227](/../../issues/1227)
- [ ] A [RELEASE.md](process/release.md) file that provides documentation on the release methodology, cadence, criteria, etc.
- (exists but requires review)
- [ ] A [GOVERNANCE.md](../GOVERNANCE.md) file that documents the project’s technical governance. [#1229](/../../issues/1229)
- [X] A [GOVERNANCE.md](../GOVERNANCE.md) file that documents the project’s technical governance. [#1229](/../../issues/1229)
- [ ] A [SUPPORT.md](../SUPPORT.md) file to let users and developers know about ways to get help with your project. [#1230](/../../issues/1230)
- Infrastructure/Assets
- [!] License scan completed and no issues found
- **NOTE: we need to fix: https://github.com/AcademySoftwareFoundation/rez/issues/1349**
- [X] License scan completed and no issues found
- [X] Code repository imported to ASWF GitHub organization or ownership of current GitHub organization given to `thelinuxfoundation` user
- [X] Developer Certificate of Origin past commit signoff done and DCO Probot enabled.
- [X] Issue/feature tracker established (JIRA, GitHub issues)
Expand All @@ -48,16 +47,16 @@ Misc stuff not covered in the ASWF list
- New Project Goverance
- [X] TSC members identified
- [X] First TSC meeting held
- [ ] TSC meeting cadence set and added to project calendar
- [ ] CLA Approved ( if used ) ( [CCLA](ccla.md) and [ICLA](icla.md) )
- [X] TSC meeting cadence set and added to project calendar
- [x] CLA Approved ( if used ) ( [CCLA](ccla.md) and [ICLA](icla.md) )
- Project charter ( [charter.md](charter.md) )
- [ ] Approved by TSC
- [ ] Filed ( create pull request against [foundation repo](https://github.com/AcademySoftwareFoundation/foundation) )
- [x] Approved by TSC
- [x] Filed ( create pull request against [foundation repo](https://github.com/AcademySoftwareFoundation/foundation) )
- [ ] [Core Infrastructure Initiative Best Practices Badge](https://bestpractices.coreinfrastructure.org/) achieved as the 'Passing' level.
- [ ] TAC representative appointed
- [X] TAC representative appointed
- Outreach
- [X] New project annoucement done ( create [issue on foundation repo](https://github.com/AcademySoftwareFoundation/foundation/issues/new) to trigger )
- [ ] Project added to ASWF website and ASWF landscape
- [X] Project added to ASWF website and ASWF landscape
- Adopted Stage graduation requirements
- [ ] CII Badge achieved
- [ ] Demonstrate a substantial ongoing flow of commits and merged contributions, authored by a healthy number of diverse contributors*.
Expand Down
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,37 @@

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

## 3.1.0 (2024-03-30)
[Source](https://github.com/AcademySoftwareFoundation/rez/tree/3.1.0) | [Diff](https://github.com/AcademySoftwareFoundation/rez/compare/3.3.0...3.1.0)

### Features

- Add support for `virtualenv` in the installer [\#1645](https://github.com/AcademySoftwareFoundation/rez/pull/1645) ([@Pixel-Minions](https://github.com/Pixel-Minions))
- Add `-e/--editable` flag to the installer to create an editable install [\#1672](https://github.com/AcademySoftwareFoundation/rez/pull/1672) ([@JeanChristopheMorinPerso](https://github.com/JeanChristopheMorinPerso))

### Fixes

- Add retry mechanism when renaming folders on Windows [\#1666](https://github.com/AcademySoftwareFoundation/rez/pull/1666) ([@loonghao](https://github.com/loonghao))
- Apply package orderers on variants [\#1684](https://github.com/AcademySoftwareFoundation/rez/pull/1684) ([@isohedronpipeline](https://github.com/isohedronpipeline) and [@pmolodo](https://github.com/pmolodo))

### Documentation

- Remove the note about Python 2.7 compatibility from the docs [\#1644](https://github.com/AcademySoftwareFoundation/rez/pull/1644) ([@vergeev](https://github.com/vergeev))
- Add clear information on how to contact maintainers [\#1659](https://github.com/AcademySoftwareFoundation/rez/pull/1659) ([@JeanChristopheMorinPerso](https://github.com/JeanChristopheMorinPerso))
- Installation instructions now include how to download rez [\#1660](https://github.com/AcademySoftwareFoundation/rez/pull/1660) ([@JeanChristopheMorinPerso](https://github.com/JeanChristopheMorinPerso))
- Add development environment docs to [CONTRIBUTING.md](./CONTRIBUTING.md) [\#1633](https://github.com/AcademySoftwareFoundation/rez/pull/1633) ([@BryceGattis](https://github.com/BryceGattis))
- Improve clarity and expliciteness of `rez-env --command` flag help [\#1682](https://github.com/AcademySoftwareFoundation/rez/pull/1682) ([@BryceGattis](https://github.com/BryceGattis))
- Add releasing packages documentation [\#1689](https://github.com/AcademySoftwareFoundation/rez/pull/1689) ([@BryceGattis](https://github.com/BryceGattis))
- Improve clarify of early binding functions documentation [\#1677](https://github.com/AcademySoftwareFoundation/rez/pull/1677) ([@BryceGattis](https://github.com/BryceGattis))

### Miscellaneous

- Remove Python2-related `__future__` imports [\#1640](https://github.com/AcademySoftwareFoundation/rez/pull/1640) ([@vergeev](https://github.com/vergeev))
- Replace usages of `rez.vendor.enum` with the built-in enum module [\#1649](https://github.com/AcademySoftwareFoundation/rez/pull/1649) ([@predat](https://github.com/predat))
- Remove `rez.backport` [\#1634](https://github.com/AcademySoftwareFoundation/rez/pull/1634) ([@BryceGattis](https://github.com/BryceGattis))
- Remove `rez.utils.json` [\#1673](https://github.com/AcademySoftwareFoundation/rez/pull/1673) ([@BryceGattis](https://github.com/BryceGattis))
- Remove `rez.utils.py23` and cleanup more python 2.7 leftovers [\#1678](https://github.com/AcademySoftwareFoundation/rez/pull/1678) ([@wandth](https://github.com/wandth))

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

Expand Down
7 changes: 5 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Build instructions

To build the docs you must use Python 3.11.
To build the docs you must install the following requirements:

- GNU Make (Linux + Mac only)
- Python 3.11

To create a build environment run the following commands:
```python
Expand All @@ -9,7 +12,7 @@ source .venv/bin/activate
pip install -r docs/requirements.txt

cd docs
make html
make html # .\make html on Windows
```

# Example Headers
Expand Down
2 changes: 2 additions & 0 deletions docs/source/building_packages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ package with two python-based variants might look like this:
The current working directory is set to the *build path* during a build.

.. _the-build-environment:

The Build Environment
=====================

Expand Down
4 changes: 2 additions & 2 deletions docs/source/environment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ removed**:
Build Environment Variables
===========================

These are variables that rez generates within a build environment, in addition
to those listed :ref:`here <context-environment-variables>`.
These are variables that rez generates within a :ref:`build environment <the-build-environment>`, in addition
to context environment variables listed :ref:`here <context-environment-variables>`.

.. glossary::

Expand Down
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Welcome to rez's documentation!
getting_started
basic_concepts
building_packages
releasing_packages
context
variants
guides/index
Expand Down
18 changes: 13 additions & 5 deletions docs/source/package_definition.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,19 @@ and *late binding* functions - and these are decorated using ``@early`` and ``@l
Early Binding Functions
+++++++++++++++++++++++

Early binding functions use the ``@early`` decorator. They are evaluated at *build time*, hence the
'early' in 'early binding'. Any package attribute can be implemented as an early binding function.

Here is an example of an :attr:`authors` attribute that is automatically set to the contributors of the
package's git project:
Early binding functions use the ``@early`` decorator. They are evaluated at
*build time*, hence the 'early' in 'early binding' and their definition persists
in the installed ``package.py``. By 'build time', it is meant that they are
evaluated before the resolve has occurred, and as such, before the
:ref:`build environment <the-build-environment>` has been constructed. Therefore
there are some important distinctions that set early-bound functions apart from
other function attributes:

- The :attr:`this` object only exposes package attributes. Nothing else is accessible when inside an early-bound function.
- No rez-set :doc:`environment variables <environment>` can be accessed inside an early bound function.

Any package attribute can be implemented as an early binding function. Here is an example of an :attr:`authors`
attribute that is automatically set to the contributors of the package's git project:

.. code-block:: python
Expand Down
27 changes: 27 additions & 0 deletions docs/source/releasing_packages.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
==================
Releasing packages
==================

Rez packages can be built and deployed to the :data:`release_packages_path`
using the :ref:`rez-release` tool. This tool performs the following actions:

* All :doc:`actions <building_packages>` that the ``rez-build`` tool performs.
* Executes all configured :data:`release_hooks`.
* Executes all configured :gh-rez:`src/rezplugins/release_vcs` plugins.

When to release vs build
============================
Packages *can* be installed to the :data:`release_packages_path` manually
by running :option:`rez-build -i --prefix /path/to/repo <rez-build --prefix>`, so why would you use
``rez-release``?

Well, here are a few benefits of ``rez-release``:

* The package will automatically go to the configured :data:`release_packages_path`, whereas :ref:`rez-build` will go to the :data:`local_packages_path` by default.
* Tests being run by with the :ref:`rez-test` tool can run specifically prior to release, ensuring that releases pass any configured tests first.
* Automatic sanity checks to ensure local repo is ready for release.
* Automatic VCS tagging.
* Many :ref:`helpful package attributes <release-package-attributes>` are automatically added to the released package definition file.

If you're working locally, these additional steps and checks may slow you
down, so it may be better to stick with :ref:`rez-build`.
21 changes: 15 additions & 6 deletions install.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,19 +147,19 @@ def copy_completion_scripts(dest_dir):
return None


def install(dest_dir, print_welcome=False):
def install(dest_dir, print_welcome=False, editable=False):
"""Install rez into the given directory.
Args:
dest_dir (str): Full path to the install directory.
"""
print("installing rez to %s..." % dest_dir)
print("installing rez%s to %s..." % (" (editable mode)" if editable else "", dest_dir))

# create the virtualenv
create_virtual_environment(dest_dir)

# install rez from source
install_rez_from_source(dest_dir)
install_rez_from_source(dest_dir, editable=editable)

# patch the rez binaries
patch_rez_binaries(dest_dir)
Expand Down Expand Up @@ -222,11 +222,15 @@ def install(dest_dir, print_welcome=False):
print('')


def install_rez_from_source(dest_dir):
def install_rez_from_source(dest_dir, editable):
_, py_executable = get_virtualenv_py_executable(dest_dir)

# install via pip
run_command([py_executable, "-m", "pip", "install", "."])
args = [py_executable, "-m", "pip", "install"]
if editable:
args.append("-e")
args.append(".")
run_command(args)


def install_as_rez_package(repo_path):
Expand Down Expand Up @@ -280,6 +284,11 @@ def install_as_rez_package(repo_path):
help="Install rez as a rez package. Note that this installs the API "
"only (no cli tools), and DIR is expected to be the path to a rez "
"package repository (and will default to ~/packages instead).")
parser.add_argument(
"-e", "--editable", action="store_true",
help="Make the install an editable install (pip install -e). This should "
"only be used for development purposes"
)
parser.add_argument(
"DIR", nargs='?',
help="Destination directory. If '{version}' is present, it will be "
Expand Down Expand Up @@ -314,4 +323,4 @@ def install_as_rez_package(repo_path):
if opts.as_rez_package:
install_as_rez_package(dest_dir)
else:
install(dest_dir, print_welcome=True)
install(dest_dir, print_welcome=True, editable=opts.editable)
7 changes: 5 additions & 2 deletions src/rez/cli/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ def setup_parser(parser, completions=False):
help="skip loading of startup scripts")
command_action = parser.add_argument(
"-c", "--command", type=str,
help="read commands from string. Alternatively, list command arguments "
"after a '--'")
help="execute command within rez environment and exit, instead of "
"starting an interactive shell. Alternatively, list command after a "
"'--'. The command and arguments passed to '-c' must be passed in as "
"a single shell argument, whereas the command and arguments after "
"'--' may be passed in as several shell arguments.")
parser.add_argument(
"-s", "--stdin", action="store_true",
help="read commands from standard input")
Expand Down
7 changes: 6 additions & 1 deletion src/rez/data/tests/solver/packages/pyvariants/2/package.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
name = "pyvariants"
version = "2"

variants = [["python-2.7.0"], ["python-2.6.8", "nada"]]
variants = [
["python-2.7.0"],
["python-2.6.8", "nada"],
["python-2.6.8"],
["nada"],
]
3 changes: 2 additions & 1 deletion src/rez/package_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from rez.utils.logging_ import print_warning
from rez.packages import get_variant
from rez.system import system
from rez.utils.filesystem import rename


class PackageCache(object):
Expand Down Expand Up @@ -330,7 +331,7 @@ def remove_variant(self, variant):
os.chmod(rootpath, st.st_mode | stat.S_IWUSR)

# actually a mv
os.rename(rootpath, dest_rootpath)
rename(rootpath, dest_rootpath)

except OSError as e:
if e.errno == errno.ENOENT:
Expand Down
Loading

0 comments on commit c6658da

Please sign in to comment.