Yay

Latest version: v3.1.1

Safety actively analyzes 630254 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 6 of 12

0.0.37

-------------------

- Brown paper bag release to remove stray print.

0.0.36

-------------------

- There is now a ``home://`` URL handler. For my laptop this means::

import yay
yay.load_uri("home://foo/bar.yay")

Is equivalent to::

import yay
yay.load_uri("/home/john/foo/bar.yay")

- Improve searchpath handling to better cope with URIs.

- Add support for ``else`` keyword in expressions as per YEP2::

foo:
bar: ${foo.baz else 52}

This is useful for providing sensible defaults in your recipes.

- The loop block is now autoflattening. This means that constructs that yield
lists of lists will be turned into 1-dimensional lists by ``.foreach``. For
example::

somelist:
- - - a
- b
- c
- d

someotherlist.foreach var in somelist: ${var}

The list ``someotherlist`` would now contain::

somelist:
- a
- b
- c
- d

The previous behaviour can be obtained with the ``chain`` modifier::

somelist.foreach var in somelist chain: ${var}

- Add a simple macro language. This is highly EXPERIMENTAL and subject to
frequent syntax tweaks. You can define a reusable block of configuration
using the .define statement. An example of this in Yaybu to create a reusable
virtualenv step::

.define Virtualenv:
- Directory:
name: ${venv.location}
owner: ${venv.owner}
- Execute:
name: create-virtualenv-${venv.location}
command: virtualenv --no-site-packages ${venv.location}
creates: ${venv.location}/bin/pip
- Execute:
name: install-requirements-${venv.location}
command: ${venv.location}/bin/pip install -r ${venv.requirements}

The macro is callable inline as part of an expression. For example::

resources.append:
.foreach venv in virtualenvs: ${Virtualenv!}

Equally you can do this::

.define Virtualenv:
- Directory:
name: ${location}
owner: ${owner}
SNIP

resources.append:
Virtualenv!:
location: /tmp/example
owner: dave
requirements: /tmp/requirements.txt

0.0.35

-------------------

- This release refactors ProtectedString to make it more useful outside Yay.
Instead of importing ``yay.protectedstring.ProtectedString`` you should
import ``yay.String``

- You can now pass strings to the constructor and they will automatically be
wrapped. Previously you had to pass StringPart's to the constructor. That is
now an internal implementation detail.

- There is now an extend() function. This accepts lists that contains a mixture
of raw strings and other ``String`` objects::

s = String("echo")
y = String("supersekritpassword", secret=True)
s.extend(["a", "b", y, "d"])

- There is now an as_list() function. This returns all the parts you have added
to a string. This is useful if you are building a command line to pass to
subprocess::

s.String(["someprogram", "--pasword"])
s.add_secret("password")

Log the obfuscated version but execute with the real password
log.info(s.protected)
p = subprocess.Popen(s.as_list(secret=False), cwd="/")

- There is now a ``secret`` call in Yay for exercising secret Yay without
needing to use GPG. This is mainly for test purposes, but might be useful if
you have strings which arent closely guarded secrets yet you dont want them
show in logs. To use it you do something like this::

resources.append:
- Checkout:
name: /checkouts/mycode
repository: http://github.com/whatever
scm_password.secret: mypassword

This example is from Yaybu and would stop Yaybu from logging your SVN
password.

0.0.34

-------------------

- Compose now reuses Opener() rather than creating a new one for each stream
loaded.

0.0.33

-------------------

- You can now pass ``searchpath`` to the ``Config`` object.

0.0.32

-------------------

- Working package:// imports

Page 6 of 12

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.