Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
The mozanalysis
Python library is a library to standardize experiment analysis
at Mozilla for the purpose of producing decision reports templates that are
edited by data scientists.
Online documentation is available at https://mozilla.github.io/mozanalysis/
pip install mozanalysis
Dependencies are specified in the requirements.txt
and requirements-dev.txt
files, which are used for testing and development respecitvely.
To create a virtualenv and set up the package execute the following, replacing requirements.txt
with requirements-dev.txt
if you plan on contributing to the package.
# Create and activate a python virtual environment.
python3 -m venv venv/
source venv/bin/activate
pip install -r requirements.txt
pip install -e . --no-dependencies
Linting and Formatting are done with Ruff.
When adding new dependencies, add them to the pyproject.toml
dependencies
list. Then generate updated requirements files using the script script/update_deps
. pip-compile
is called in this script, which uses the specified dependencies to create the requirements.txt
and requirements-dev.txt
files. Finally, you'll want to update the requirements in your virtual env by running pip install -r requirements-dev.txt
Run pytest
on the commandline from the root of the package file structure.
Tox is included in the dev dependencies. If you want to run with tox, install the dev dependencies in the requirements-dev.txt
as detailed above.
You can pass flags to tox to limit the different environments you test in
or the tests you run. Options after --
or positional arguments are forwarded to pytest.
For example, you can run:
tox -e lint
to lint
tox -e py310 -- -k utils
to only run tests with "utils" somewhere in the name, on Python 3.10
tox tests/test_utils.py
to run tests in a specific file
To test/debug this package locally, you can run exactly the job that CircleCI runs for continuous integration by installing the CircleCI local CLI and invoking:
circleci build --job py310
See .circleci/config.yml for the other configured job names (for running tests on different python versions).
Releasing mozanalysis happens by tagging a CalVer based Git tag with the following pattern:
YYYY.M.MINOR
where YYYY is the four-digit year number, M is a single-digit month number and MINOR is a single-digit zero-based counter which does NOT relate to the day of the release. Valid versions numbers are:
2017.10.0
2018.1.0
2018.12.12
Once the (signed) Git tag has been pushed to the main GitHub repository using git push origin --tags, Circle CI will automatically build and push a release to PyPI after the tests have passed.
FAQs
A library for Mozilla experiments analysis
We found that mozanalysis demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.