Skip to content
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

[wiki] Move update utils into main repo #831

Merged
merged 11 commits into from
Aug 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions .github/workflows/wiki.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Wiki
on:
push:
branches:
- master
paths:
- 'wiki/**'
pull_request:
paths:
- 'wiki/**'
env:
CLONE_URL: "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.wiki.git"

jobs:
build:
name: Build Wiki Artifact
runs-on: ubuntu-latest
env:
TEMP_WIKI_DIR: "wiki/.rez-gen-wiki-tmp"

steps:
- name: Checkout
uses: actions/checkout@v1

- name: Set up Python 2.7
uses: actions/setup-python@v1
with:
python-version: 2.7

- name: Build Wiki
run: |
git config --global color.ui always
if [ "${{ github.event_name == 'pull_request' }}" == "true" ]
then
BRANCH="${{ github.head_ref }}"
else
BRANCH="${{ github.ref }}"
fi

python wiki/update-wiki.py \
--keep-temp \
--no-push \
--github-branch="${BRANCH##refs*/}" \
--wiki-dir="${{ env.TEMP_WIKI_DIR }}" \
--wiki-url="${{ env.CLONE_URL }}"

- uses: actions/upload-artifact@v1.0.0
with:
name: wiki-markdown
path: ${{ env.TEMP_WIKI_DIR }}


publish:
name: Publish to GitHub Wiki
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
needs: build

steps:
- uses: actions/download-artifact@master
with:
name: wiki-markdown
path: .

- name: Setup git config
run: |
git config --global color.ui always
git config --global user.name "github.com/${{ github.actor }}"
git config --global user.email "${{ github.actor }}@${{ github.sha }}"

- name: Git commit and push
run: |
git commit \
-m "Generated from GitHub "${{ github.workflow }}" Workflow" \
-m "See https://github.com/${{ github.repository }}/runs/${GITHUB_ACTION}" \
|| exit 0
git remote set-url origin "${{ env.CLONE_URL }}"
git push origin master
16 changes: 13 additions & 3 deletions src/rez/cli/_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,12 @@ def __call__(self, parser, args, values, option_string=None):
sys.exit(0)


def run(command=None):

sys.dont_write_bytecode = True
def setup_parser():
"""Create and setup parser for given rez command line interface.

Returns:
LazyArgumentParser: Argument parser for rez command.
"""
parser = LazyArgumentParser("rez")

parser.add_argument("-i", "--info", action=InfoAction,
Expand All @@ -99,6 +101,13 @@ def run(command=None):
help='', # required so that it can be setup later
setup_subparser=SetupRezSubParser(module_name))

return parser


def run(command=None):

sys.dont_write_bytecode = True

# construct args list. Note that commands like 'rez-env foo' and
# 'rez env foo' are equivalent
if command:
Expand All @@ -115,6 +124,7 @@ def run(command=None):
else:
arg_mode = None

parser = setup_parser()
if arg_mode == "grouped":
# args split into groups by '--'
arg_groups = [[]]
Expand Down
43 changes: 0 additions & 43 deletions wiki/pages/Command-Line-Tools.md

This file was deleted.

112 changes: 112 additions & 0 deletions wiki/pages/Home.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
[[media/rez_banner_128.png]]

- [What Is Rez?](#what-is-rez)
- [The Basics](#the-basics)
- [Examples](#examples)


## What Is Rez?

Rez is a cross-platform package manager with a difference. Using Rez you can create
standalone environments configured for a given set of packages. However, unlike many
other package managers, packages are not installed into these standalone environments.
Instead, all package versions are installed into a central repository, and standalone
environments reference these existing packages. This means that configured environments
are lightweight, and very fast to create, often taking just a few seconds to configure
despite containing hundreds of packages.

<p align="center">
<a href="https://github.com/nerdvegas/rez/wiki/media/other_pkg_mgr.png">
<img src="https://github.com/nerdvegas/rez/wiki/media/other_pkg_mgr.png"></a>
<br><i>Typical package managers install packages into an environment</i>
</p>

<br>
<p align="center">
<a href="https://github.com/nerdvegas/rez/wiki/media/rez_pkg_mgr.png">
<img src="https://github.com/nerdvegas/rez/wiki/media/rez_pkg_mgr.png"></a>
<br><i>Rez installs packages once, and configures environments dynamically</i>
</p>

<br>
Rez takes a list of package requests, and constructs the target environment, resolving
all the necessary package dependencies. Any type of software package is supported -
compiled, python, applications and libraries.


## The Basics

Packages are stored in repositories on disk. Each package has a single concise
definition file (*package.py*) that defines its dependencies, its commands (how it
configures the environment containing it), and other metadata. For example, the
following is the package definition file for the popular *requests* python module:

name = "requests"

version = "2.8.1"

authors = ["Kenneth Reitz"]

requires = [
"python-2.7+"
]

def commands():
env.PYTHONPATH.append("{root}/python")

This package requires python-2.7 or greater. When used, the 'python' subdirectory
within its install location is appended to the PYTHONPATH environment variable.

When an environment is created with the rez API or *rez-env* tool, a dependency
resolution algorithm tracks package requirements and resolves to a list of needed
packages. The commands from these packages are concatenated and evaluated, resulting
in a configured environment. Rez is able to configure environments containing
hundreds of packages, often within a few seconds. Resolves can also be saved to file,
and when re-evaluated later will reconstruct the same environment once more.


## Examples

This example places the user into a resolved shell containing the requested packages,
using the [rez-env](https://github.com/nerdvegas/rez/wiki/Command-Line-Tools#rez-env) tool:

]$ rez-env requests-2.2+ python-2.6 'pymongo-0+<2.7'

You are now in a rez-configured environment.

resolved by ajohns@nn188.somewhere.com, on Wed Feb 26 15:56:20 2014, using Rez v2.0.0

requested packages:
requests-2.2+
python-2.6
pymongo-0+<2.7

resolved packages:
python-2.6.8 /software/ext/python/2.6.8
platform-linux /software/ext/platform/linux
requests-2.2.1 /software/ext/requests/2.2.1/python-2.6
pymongo-2.6.3 /software/ext/pymongo/2.6.3
arch-x86_64 /software/ext/arch/x86_64

> ]$ _

This example creates an environment containing the package 'houdini' version 12.5
or greater, and runs the command 'hescape -h' inside that environment:

]$ rez-env houdini-12.5+ -- hescape -h
Usage: hescape [-foreground] [-s editor] [filename ...]
-h: output this usage message
-s: specify starting desktop by name
-foreground: starts process in foreground

Resolved environments can also be created via the API:

>>> import subprocess
>>> from rez.resolved_context import ResolvedContext
>>>
>>> r = ResolvedContext(["houdini-12.5+", "houdini-0+<13", "java", "!java-1.8+"])
>>> p = r.execute_shell(command='which hescape', stdout=subprocess.PIPE)
>>> out, err = p.communicate()
>>>
>>> print out
'/software/ext/houdini/12.5.562/bin/hescape'
4 changes: 4 additions & 0 deletions wiki/pages/Notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@


## Bez Deprecation

3 changes: 3 additions & 0 deletions wiki/pages/_Command-Line-Tools.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Auto-generated from __WIKI_PY_URL__

__GENERATED_MD__
4 changes: 2 additions & 2 deletions wiki/pages/_Configuring-Rez.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Rez has a good number of configurable settings. The default settings, and
documentation for every setting, can be found
[here](https://github.com/nerdvegas/rez/blob/master/src/rez/rezconfig.py).
[here](https://github.com/__GITHUB_REPO__/blob/master/src/rez/rezconfig.py).

Settings are determined in the following way:

Expand Down Expand Up @@ -102,7 +102,7 @@ Here is an example showing how to override settings using your own configuration
Following is an alphabetical list of rez settings.

> [[media/icons/info.png]] Note that this list has been generated automatically
> from the [rez-config.py](https://github.com/nerdvegas/rez/blob/master/src/rez/rezconfig.py)
> from the [rez-config.py](https://github.com/__GITHUB_REPO__/blob/master/src/rez/rezconfig.py)
> file in the rez source, so you can also refer to that file for the same information.

__REZCONFIG_MD__
4 changes: 4 additions & 0 deletions wiki/pages/__Footer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[![Google Group](https://img.shields.io/badge/rez--config-Google%20Group-blue?style=flat-square&logo=google)](https://groups.google.com/forum/#!forum/rez-config)
[![Contributing Guidelines](https://img.shields.io/badge/rez-Contributing%20Guidelines-0b610e?style=flat-square&logo=github)](https://github.com/__GITHUB_REPO__/blob/master/CONTRIBUTING.md)
[![Report A Bug](https://img.shields.io/badge/rez-Report%20A%20Bug-critical?style=flat-square&logo=github)](https://github.com/__GITHUB_REPO__/issues/new)
[![Slack](https://img.shields.io/badge/slack-rez--talk-7a6800?style=flat-square&logo=slack)](https://rez-talk.slack.com/)
49 changes: 49 additions & 0 deletions wiki/pages/__Sidebar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
[![][wiki-badge]][wiki-actions]

[wiki-badge]: https://github.com/__GITHUB_REPO__/workflows/__WORKFLOW__/badge.svg?branch=__BRANCH__
[wiki-actions]: https://github.com/__GITHUB_REPO__/actions?query=workflow%3A__WORKFLOW__+branch%3A__BRANCH__

- [[Home]]

:beginner: Introduction:

- [[Installation]] and [[Pip]]
- [[Getting Started]]
- [[Basic Concepts]]
- [[Configuring Rez]]

:memo: `package.py`:

- [[Package Commands]]
- [[Package Definition Guide]]
- [[Variants]]

:rocket: rez:

- [[Contexts]]
- [[Suites]]
- [[Building Packages]]
- [[Environment Variables]]
- [[Command Line Tools]]
- [Python API](https://___GITHUB_USER___.github.io/__REPO_NAME__/) :link:

:information_source: Others:

- [[Glossary]]
- [[FAQ]]
- [[Notes]]
- [[Credits]]

<details><summary> :construction: Unwritten pages:</summary>

- [[Advanced Topics]]
- [[Caching]]
- [[Releasing Packages]]
- [[Package Filters]]
- [[Testing Packages]]
- [[Rez GUI]]
- [[The Resolve Graph]]
- [[Timestamping]]
- [[Troubleshooting]]

</details>
Loading