
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
pysetenv is a simple Python-based program to allow users to set environment variables before executing a command, similar to the POSIX ```env`` https://pubs.opengroup.org/onlinepubs/9699919799/utilities/env.html`__ command.
pysetenv is designed as a support package to help authors of other
Python packages create command-line strings like you'd expect from
sh
or the env
command. Generally, pysetenv will only be
installed on Windows systems, with POSIX systems using sh
or
env
. For example, in your setup.py
, you would write:
.. code:: python
setup(
# ...
install_requires=['pysetenv;platform_system=="Windows"'],
)
Then somewhere in your code, you could call pysetenv:
.. code:: python
subprocess.call(['pysetenv', ...])
Usage: pysetenv [OPTION]... [NAME=VALUE]... [--] [COMMAND [ARG]...]
pysetenv supports a subset of common options available to various
implementations of env
. It executes COMMAND
with any supplied
arguments (ARG
) after modifying the environment as specified by the
previous arguments. Any arguments of the form NAME=VALUE
will set an
environment variable NAME
to the value of VALUE
. If COMMAND
is not specified, pysetenv will print the resulting environment instead.
In addition, the following options are supported:
-i
: Ignore any environment variables inherited by this process-u NAME
: Unset the environment variable NAME
-h
, --help
: Show a help message and exit--version
: Show the current version and exitAs an extension to the env
command, the options above and the
variable definitions can be separated from the section for defining the
command to run with --
:
.. code:: sh
pysetenv -uFOO BAR=value -- echo hello
This project is licensed under the BSD 3-clause license <LICENSE>
__.
FAQs
A simple tool to set environment variables before running a command
We found that pysetenv demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.