Skip to content

Commit 6902d31

Browse files
Merge pull request #371 from bug-or-feature/migrate_to_uv
2 parents 18b8b9b + 041fed9 commit 6902d31

15 files changed

Lines changed: 127 additions & 178 deletions

.flake8

Lines changed: 0 additions & 4 deletions
This file was deleted.

.github/workflows/integration-test.yml

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,28 @@
22
name: trading-ig integration test
33

44
on:
5-
schedule:
6-
- cron: '25 2 * * 1-4'
5+
# schedule:
6+
# - cron: '25 2 * * 1-4'
77
workflow_dispatch:
88

99
jobs:
1010
build:
11-
if: github.repository == 'ig-python/trading-ig'
11+
# if: github.repository == 'ig-python/trading-ig'
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
- uses: actions/checkout@v4
16-
- name: Set up Python 3.10
17-
uses: actions/setup-python@v5
15+
- uses: actions/checkout@v6
16+
17+
- name: Install uv and setup Python
18+
uses: astral-sh/setup-uv@v7
1819
with:
20+
version: "0.11.6"
1921
python-version: "3.10"
20-
- name: Install Poetry
21-
uses: abatilo/actions-poetry@v4
22-
with:
23-
poetry-version: "latest"
24-
- name: Setup a local virtual environment
25-
run: |
26-
poetry config virtualenvs.create true --local
27-
poetry config virtualenvs.in-project true --local
28-
- uses: actions/cache@v3
29-
name: Define a cache for the virtual environment based on the dependencies lock file
30-
with:
31-
path: ./.venv
32-
key: venv-${{ hashFiles('poetry.lock') }}
22+
3323
- name: Install dependencies
3424
run: |
35-
poetry install --extras "pandas munch tenacity"
25+
uv sync --all-extras --dev
26+
3627
- name: Integration test with pytest
3728
env:
3829
IG_SERVICE_USERNAME: ${{ secrets.IG_SERVICE_USERNAME }}
@@ -41,10 +32,11 @@ jobs:
4132
IG_SERVICE_ACC_TYPE: ${{ secrets.IG_SERVICE_ACC_TYPE }}
4233
IG_SERVICE_ACC_NUMBER: ${{ secrets.IG_SERVICE_ACC_NUMBER_1 }}
4334
run: |
44-
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"
45-
poetry run coverage report
35+
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"
36+
uv run coverage report
37+
4638
- name: Coveralls
4739
env:
4840
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4941
run: |
50-
poetry run coveralls --service=github
42+
uv run coveralls --service=github

.github/workflows/python-publish.yml

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,25 @@ jobs:
1010

1111
runs-on: ubuntu-latest
1212

13+
environment:
14+
name: pypi
15+
16+
permissions:
17+
id-token: write
18+
contents: read
19+
1320
steps:
14-
- uses: actions/checkout@v4
15-
- name: Set up Python
16-
uses: actions/setup-python@v5
21+
- name: Checkout
22+
uses: actions/checkout@v6
23+
24+
- name: Install uv and Python
25+
uses: astral-sh/setup-uv@v7
1726
with:
27+
version: "0.11.6"
1828
python-version: "3.10"
19-
- name: Install Poetry
20-
uses: abatilo/actions-poetry@v3
21-
with:
22-
poetry-version: "latest"
23-
- name: Build and publish
24-
env:
25-
PYPI_USERNAME: __token__
26-
PYPI_PASSWORD: ${{ secrets.PYPI_TOKEN }}
27-
run: |
28-
poetry publish -u $PYPI_USERNAME -p $PYPI_PASSWORD --build
29+
30+
- name: Build
31+
run: uv build
32+
33+
- name: Publish
34+
run: uv publish

.github/workflows/unit-test.yml

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,26 @@ jobs:
1717

1818
steps:
1919

20-
- uses: actions/checkout@v4
20+
- uses: actions/checkout@v6
2121

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

27-
- name: Install Poetry
28-
uses: abatilo/actions-poetry@v3
29-
with:
30-
poetry-version: "latest"
31-
3228
- name: Install dependencies
3329
run: |
34-
poetry install --extras "pandas munch tenacity"
30+
uv sync --all-extras --dev
3531
36-
- name: Prettify with black
37-
uses: psf/black@stable
38-
with:
39-
version: "23.3.0"
32+
- name: Check code prettiness with ruff
33+
run: |
34+
uv run ruff format --check
4035
41-
- name: Lint with flake8
36+
- name: Lint with ruff
4237
run: |
43-
poetry run flake8 trading_ig docs sample tests
38+
uv run ruff check trading_ig docs sample tests
4439
4540
- name: Unit tests with pytest
4641
run: |
47-
poetry run pytest --ignore=tests/test_integration.py
42+
uv run pytest --ignore=tests/test_integration.py

README.rst

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -62,33 +62,13 @@ For full details, see `pyproject.toml <https://github.com/ig-python/trading-ig/b
6262
Installation
6363
------------
6464

65-
This project uses `Poetry <https://python-poetry.org/>`_.
66-
67-
Adding to an existing Poetry project::
68-
69-
$ poetry add trading-ig
70-
71-
With all the optional dependencies::
72-
73-
$ poetry add trading-ig[pandas,munch,tenacity]
74-
75-
Cloning the project with Poetry::
76-
77-
$ git clone https://github.com/ig-python/trading-ig
78-
$ cd trading-ig
79-
$ poetry install
80-
81-
And with all optional dependencies::
82-
83-
$ poetry install --extras "pandas munch tenacity"
84-
8565
Installing with pip::
8666

8767
$ pip install trading-ig
8868

89-
And with all optional dependencies::
69+
Installing with all optional dependencies::
9070

91-
$ pip install trading-ig pandas munch tenacity
71+
$ pip install "trading-ig[pandas, munch, tenacity]"
9272

9373
What if I need help?
9474
--------------------

docs/source/faq.rst

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ exceeded one of the limits.
7777

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

80-
IGService.get_client_apps()
80+
IGService.get_client_apps()
8181

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

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

221-
$ poetry run black .
221+
$ uv run ruff format
222222

223223
and for linting::
224224

225-
$ poetry run flake8 trading_ig docs sample tests
225+
$ uv run ruff check trading_ig docs sample tests
226226

227227
for unit tests::
228228

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

231231
for integration tests::
232232

233-
$ poetry run pytest tests/test_integration.py
233+
$ uv run pytest tests/test_integration.py
234234

235235
for unit and integration tests::
236236

237-
$ poetry run pytest
237+
$ uv run pytest
238238

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

241-
$ poetry run pytest --runslow
241+
$ uv run pytest --runslow
242242

243243

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

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

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

340342
.. _why-is-pandas-an-optional-dependency-in-pyproject-toml:
341343
.. _optional-dependencies:

docs/source/quickstart.rst

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,13 @@ Quickstart
44
Installation
55
------------
66

7-
This project uses `Poetry <https://python-poetry.org/>`_.
8-
9-
Adding to an existing Poetry project::
10-
11-
$ poetry add trading-ig
12-
13-
With all the optional dependencies::
14-
15-
$ poetry add trading-ig[pandas,munch,tenacity]
16-
17-
Cloning the project with Poetry::
18-
19-
$ git clone https://github.com/ig-python/trading-ig
20-
$ cd trading-ig
21-
$ poetry install
22-
23-
And with all optional dependencies::
24-
25-
$ poetry install --extras "pandas munch tenacity"
26-
277
Installing with pip::
288

299
$ pip install trading-ig
3010

31-
And with all optional dependencies::
32-
33-
$ pip install trading-ig pandas munch tenacity
11+
Installing with all optional dependencies::
3412

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

3615
Configuration
3716
-------------

0 commit comments

Comments
 (0)