<commit_before>Kinto Distribution
==================

.. image:: https://circleci.com/gh/mozilla-services/kinto-dist/tree/main.svg?style=svg
   :target: https://circleci.com/gh/mozilla-services/kinto-dist

This repository contains:

1. A set requirements file that combines all packages needed to run a Kinto
   server with a known good set of dependencies.
2. Source code for several Kinto plugins that are specific to remote settings.
   These are contained in the ``kinto_remote_settings`` package.
3. An example configuration file to run it.

**The most important function of this repository is to build a Docker image
with a set of known working dependencies and then ship that to DockerHub.**

Test Locally
------------

Kinto Remote Settings Unit Tests
~~~~~~~~~~~~~~~~~~~~~~
To run unit tests, you need Postgres installed and a database ``testdb`` available. This can be created like:

.. code-block:: shell

    $ psql -c "CREATE DATABASE testdb ENCODING 'UTF8' TEMPLATE template0;" -U postgres -h localhost

You should also install the requirements found in ``dev-requirements.txt``:

.. code-block:: shell

    $ pip install -r dev-requirements.txt

After this setup is complete, run tests with ``pytest``

.. code-block:: shell<commit_msg>Instruct devs to set timezone to UTC in readme<commit_after>Kinto Distribution
==================

.. image:: https://circleci.com/gh/mozilla-services/kinto-dist/tree/main.svg?style=svg
   :target: https://circleci.com/gh/mozilla-services/kinto-dist

This repository contains:

1. A set requirements file that combines all packages needed to run a Kinto
   server with a known good set of dependencies.
2. Source code for several Kinto plugins that are specific to remote settings.
   These are contained in the ``kinto_remote_settings`` package.
3. An example configuration file to run it.

**The most important function of this repository is to build a Docker image
with a set of known working dependencies and then ship that to DockerHub.**

Test Locally
------------

Kinto Remote Settings Unit Tests
~~~~~~~~~~~~~~~~~~~~~~
To run unit tests, you need Postgres installed and a database ``testdb`` available. This can be created like:

.. code-block:: shell

    $ psql -c "CREATE DATABASE testdb ENCODING 'UTF8' TEMPLATE template0;" -U postgres -h localhost
    $ psql -c "ALTER DATABASE testdb SET TIMEZONE TO UTC;"

You should also install the requirements found in ``dev-requirements.txt``:

.. code-block:: shell

    $ pip install -r dev-requirements.txt

After this setup is complete, run tests with ``pytest``

.. code-block:: shell
{'fraction_non_alphanumeric': 0.11603700848111026, 'fraction_numerical': 0.0038550501156515036, 'mean_word_length': 3.9903846153846154, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5776232', 'n_tokens_mistral': 720, 'n_tokens_neox': 694, 'n_words': 318}