Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .flake8

This file was deleted.

38 changes: 15 additions & 23 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,28 @@
name: trading-ig integration test

on:
schedule:
- cron: '25 2 * * 1-4'
# schedule:
# - cron: '25 2 * * 1-4'
workflow_dispatch:

jobs:
build:
if: github.repository == 'ig-python/trading-ig'
# if: github.repository == 'ig-python/trading-ig'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
- uses: actions/checkout@v6

- name: Install uv and setup Python
uses: astral-sh/setup-uv@v7
with:
version: "0.11.6"
python-version: "3.10"
- name: Install Poetry
uses: abatilo/actions-poetry@v4
with:
poetry-version: "latest"
- name: Setup a local virtual environment
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- uses: actions/cache@v3
name: Define a cache for the virtual environment based on the dependencies lock file
with:
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}

- name: Install dependencies
run: |
poetry install --extras "pandas munch tenacity"
uv sync --all-extras --dev

- name: Integration test with pytest
env:
IG_SERVICE_USERNAME: ${{ secrets.IG_SERVICE_USERNAME }}
Expand All @@ -41,10 +32,11 @@ jobs:
IG_SERVICE_ACC_TYPE: ${{ secrets.IG_SERVICE_ACC_TYPE }}
IG_SERVICE_ACC_NUMBER: ${{ secrets.IG_SERVICE_ACC_NUMBER_1 }}
run: |
poetry run coverage run -m --source=trading_ig pytest --log-cli-level=DEBUG --log-format="%(asctime)s %(levelname)s %(message)s" --log-date-format="%Y-%m-%d %H:%M:%S"
poetry run coverage report
uv run coverage run -m --source=trading_ig pytest --log-cli-level=DEBUG --log-format="%(asctime)s %(levelname)s %(message)s" --log-date-format="%Y-%m-%d %H:%M:%S"
uv run coverage report

- name: Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
poetry run coveralls --service=github
uv run coveralls --service=github
32 changes: 19 additions & 13 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,25 @@ jobs:

runs-on: ubuntu-latest

environment:
name: pypi

permissions:
id-token: write
contents: read

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
- name: Checkout
uses: actions/checkout@v6

- name: Install uv and Python
uses: astral-sh/setup-uv@v7
with:
version: "0.11.6"
python-version: "3.10"
- name: Install Poetry
uses: abatilo/actions-poetry@v3
with:
poetry-version: "latest"
- name: Build and publish
env:
PYPI_USERNAME: __token__
PYPI_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
poetry publish -u $PYPI_USERNAME -p $PYPI_PASSWORD --build

- name: Build
run: uv build

- name: Publish
run: uv publish
27 changes: 11 additions & 16 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,26 @@ jobs:

steps:

- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
- name: Install uv and setup Python
uses: astral-sh/setup-uv@v7
with:
version: "0.11.6"
python-version: ${{ matrix.python-version }}

- name: Install Poetry
uses: abatilo/actions-poetry@v3
with:
poetry-version: "latest"

- name: Install dependencies
run: |
poetry install --extras "pandas munch tenacity"
uv sync --all-extras --dev

- name: Prettify with black
uses: psf/black@stable
with:
version: "23.3.0"
- name: Check code prettiness with ruff
run: |
uv run ruff format --check

- name: Lint with flake8
- name: Lint with ruff
run: |
poetry run flake8 trading_ig docs sample tests
uv run ruff check trading_ig docs sample tests

- name: Unit tests with pytest
run: |
poetry run pytest --ignore=tests/test_integration.py
uv run pytest --ignore=tests/test_integration.py
24 changes: 2 additions & 22 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,33 +62,13 @@ For full details, see `pyproject.toml <https://github.com/ig-python/trading-ig/b
Installation
------------

This project uses `Poetry <https://python-poetry.org/>`_.

Adding to an existing Poetry project::

$ poetry add trading-ig

With all the optional dependencies::

$ poetry add trading-ig[pandas,munch,tenacity]

Cloning the project with Poetry::

$ git clone https://github.com/ig-python/trading-ig
$ cd trading-ig
$ poetry install

And with all optional dependencies::

$ poetry install --extras "pandas munch tenacity"

Installing with pip::

$ pip install trading-ig

And with all optional dependencies::
Installing with all optional dependencies::

$ pip install trading-ig pandas munch tenacity
$ pip install "trading-ig[pandas, munch, tenacity]"

What if I need help?
--------------------
Expand Down
32 changes: 17 additions & 15 deletions docs/source/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ exceeded one of the limits.

You can query the limits associated with either a LIVE or DEMO API key after logging on by calling::

IGService.get_client_apps()
IGService.get_client_apps()

This is the rate used when a new IGService object is created with the use_rate_limiter kwarg set as True.

Expand Down Expand Up @@ -212,33 +212,33 @@ solutions:
How do I check my PR will pass CI checks?
-----------------------------------------
This project uses some automated continuous integration (CI) processes whenever
any code is committed, or if someone creates a PR. There are unit tests, code
formatting with ``black``, and linting with ``flake8``. In addition, an
integration test gets executed every night. The integration test takes a long
time due to the :ref:`rate limits<rate_limits>`. Before making a PR, please make
sure the tests pass - PRs will be rejected if they do not. For code formatting::
any code is committed, or if someone creates a PR. There are unit tests, and code
formatting and linting with ``ruff``. In addition, an integration test gets
executed every night. The integration test takes a long time due to the
:ref:`rate limits<rate_limits>`. Before making a PR, please make sure the tests
pass - PRs will be rejected if they do not. For code formatting::

$ poetry run black .
$ uv run ruff format

and for linting::

$ poetry run flake8 trading_ig docs sample tests
$ uv run ruff check trading_ig docs sample tests

for unit tests::

$ poetry run pytest --ignore=tests/test_integration.py
$ uv run pytest --ignore=tests/test_integration.py

for integration tests::

$ poetry run pytest tests/test_integration.py
$ uv run pytest tests/test_integration.py

for unit and integration tests::

$ poetry run pytest
$ uv run pytest

for all tests, including one *really* long running one that tests v3 sessions::

$ poetry run pytest --runslow
$ uv run pytest --runslow


.. _v2_or_v3_sessions:
Expand Down Expand Up @@ -332,10 +332,12 @@ An issue without all this information may be ignored and/or closed without respo

What happened to ``setup.py`` and ``requirements.txt``?
-------------------------------------------------------------
Early versions of this project used the standard ``setup.py`` config, with a ``requirements.txt`` file describing
dependencies. `Poetry <https://python-poetry.org/>`_
support was added with version 0.0.10 (July 2021). The old style config was removed with version 0.0.14
Early versions of this project used the standard ``setup.py`` config, with a
``requirements.txt`` file describing dependencies. `Poetry <https://python-poetry.org/>`_
support was added with version 0.0.10 (July 2021).The old style config was
removed with version 0.0.14.

We switched to `uv <https://docs.astral.sh/uv/>`_ in April 2026.

.. _why-is-pandas-an-optional-dependency-in-pyproject-toml:
.. _optional-dependencies:
Expand Down
25 changes: 2 additions & 23 deletions docs/source/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,13 @@ Quickstart
Installation
------------

This project uses `Poetry <https://python-poetry.org/>`_.

Adding to an existing Poetry project::

$ poetry add trading-ig

With all the optional dependencies::

$ poetry add trading-ig[pandas,munch,tenacity]

Cloning the project with Poetry::

$ git clone https://github.com/ig-python/trading-ig
$ cd trading-ig
$ poetry install

And with all optional dependencies::

$ poetry install --extras "pandas munch tenacity"

Installing with pip::

$ pip install trading-ig

And with all optional dependencies::

$ pip install trading-ig pandas munch tenacity
Installing with all optional dependencies::

$ pip install "trading-ig[pandas, munch, tenacity]"

Configuration
-------------
Expand Down
Loading