A library for Mozilla experiments analysis
Перейти к файлу
Mike Williams 37446df7ce
Merge pull request #351 from mozilla/update-docs-deploy-node
chore: update docs-deploy to supported dep versions
2024-10-09 11:24:43 -04:00
.circleci done testing, revert config to normal filters 2024-10-09 11:13:42 -04:00
.github Improving dependency management as per ADR 0001 (#228) 2024-05-21 09:06:57 -05:00
docs remove configloader helper objects (#233) 2024-05-22 11:11:44 -05:00
script Improving dependency management as per ADR 0001 (#228) 2024-05-21 09:06:57 -05:00
src/mozanalysis raise ValueError to be handled by caller (with suppress flag) 2024-09-24 13:52:06 -04:00
tests raise ValueError to be handled by caller (with suppress flag) 2024-09-24 13:52:06 -04:00
.gitignore Clean comments, fix bugs, add desktop Targets 2022-08-03 13:41:03 -07:00
CHANGELOG.rst Don't unpersist persisted datasets (#23) 2019-01-14 12:31:18 -08:00
CODE_OF_CONDUCT.md Add Mozilla Code of Conduct file 2019-03-30 00:01:33 -07:00
LICENSE Initial commit 2018-09-12 11:16:25 -07:00
README.md chore: more precise errors in tests; README typos 2024-07-11 12:07:56 -04:00
pyproject.toml types in experiment.py; fix incomplete test; sort/organize deps 2024-09-04 16:39:41 -04:00
requirements-dev.in Update deps (#320) 2024-09-12 14:21:06 -05:00
requirements-dev.txt Update deps (#320) 2024-09-12 14:21:06 -05:00
requirements.in Update deps (#320) 2024-09-12 14:21:06 -05:00
requirements.txt Update deps (#320) 2024-09-12 14:21:06 -05:00
tox.ini Improving dependency management as per ADR 0001 (#228) 2024-05-21 09:06:57 -05:00

README.md

Mozilla Experiments Analysis CircleCI codecov CalVer - Timely Software Versioning

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.

Documentation

Online documentation is available at https://mozilla.github.io/mozanalysis/

Installation from pypi

  • To install this package from pypi run:
pip install mozanalysis

Local Installation

Dependencies

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

Development

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

Testing locally

With pytest

Run pytest on the commandline from the root of the package file structure.

With tox

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

With the CircleCI utilities

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).

Deploying a new release

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.