Skip to content

Commit

Permalink
Adapt docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
kklein committed Oct 30, 2024
1 parent 0cd55b3 commit f429915
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 27 deletions.
38 changes: 15 additions & 23 deletions docs/source/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,21 @@ Development
===========


The repository comes with a development environment file. We suggest to use ``conda``
and ``mamba``.
The repository relies on ``pixi`` to manage dependencies. Please make sure you have a running version of `pixi <https://pixi.sh/latest/>`_.

In order to get going, you can run
In order to get going, you can run the following

::
.. code-block:: bash
# Clone the repository
git clone [email protected]:Quantco/pytsql.git
cd pytsql

# Set up a conda environment with name "pytsql" and activate it.
mamba env create
conda activate pytsql
$ git clone [email protected]:Quantco/pytsql.git
$ cd pytsql
# Set up our pre-commit hooks for black, mypy, isort and flake8.
pre-commit install
# Set up our pre-commit hooks for e.g. black, mypy and ruff.
$ pixi run pre-commit-install
# Install this package in editable mode.
pip install --no-build-isolation -e .
$ pixi run postinstall
Unit tests
Expand All @@ -30,11 +25,9 @@ Unit tests
``pytsql`` comes with some unit tests. Provided that the environment has been set
up as illustrated in the previous step, they can be run as such:

::
.. code-block:: bash
conda activate pytsql
cd pytsql
pytest tests/unit/
$ pixi run pytest tests/unit/
Integration tests
Expand All @@ -46,18 +39,17 @@ just execute the ``start_mssql.sql`` script provided.

Once the docker container is up and running, you can run the tests:

::
.. code-block:: bash
$ pixi run pytest tests/integration/
conda activate pytsql
cd pytsql
pytest tests/integration/
Add the option ``--backend=mssql-freetds`` to the test command to run the tests using
the ``freetds`` driver.


Grammar
------------------
-------

``pytsql`` relies on parsing the sql script at hand. In order to do so, it uses
`antlr <https://www.antlr.org>`_, a parser generator. ``antlr`` expects grammar files
Expand All @@ -71,7 +63,7 @@ To keep the package structure lean, ``pytql`` aims to be in sync with the refere
Therefore, if you want to extend or modify the grammar please consider contributing to the external repository instead.

Update targets
^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^

All files in ``pytsql/src/pytsql/grammar/cpp_src/antlr4-cpp-runtime`` are taken directly from
the `ANTLR repository release 4.11.1
Expand Down
8 changes: 4 additions & 4 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ Installation

To install, execute:

::
.. code-block:: bash
pip install pytsql
$ pip install pytsql
or from a ``conda`` environment

::
.. code-block:: bash
mamba install pytsql
$ conda install pytsql
Be aware that depending on your platform, you'will need specific drivers (`Windows <https://docs.microsoft.com/en-us/sql/connect/odbc/windows/microsoft-odbc-driver-for-sql-server-on-windows?view=sql-server-ver15>`_, `Linux <https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver15>`_, `macOS <https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/install-microsoft-odbc-driver-sql-server-macos?view=sql-server-ver15>`_).

0 comments on commit f429915

Please sign in to comment.