Skip to content

Commit fc61120

Browse files
committed
Switch from Poetry to uv
1 parent 447a424 commit fc61120

File tree

10 files changed

+522
-362
lines changed

10 files changed

+522
-362
lines changed

.github/workflows/python-app.yml

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
2+
# GitHub docs: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
# uv docs: https://docs.astral.sh/uv/guides/integration/github/
34

45
name: Testing
56

@@ -14,31 +15,36 @@ permissions:
1415

1516
jobs:
1617
build:
17-
runs-on: ubuntu-22.04
18+
runs-on: ubuntu-latest
1819

1920
strategy:
2021
matrix:
21-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
22+
# uv supports python 3.8 and higher
23+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
2224

2325
steps:
2426
- uses: actions/checkout@v4
25-
- name: Install Poetry
26-
run: |
27-
pipx install poetry
28-
- name: Set up Python ${{ matrix.python-version }}
29-
uses: actions/setup-python@v5
27+
28+
- name: Install uv
29+
uses: astral-sh/setup-uv@v5
3030
with:
31+
# Install a specific version of uv.
32+
version: "0.7.3"
3133
python-version: ${{ matrix.python-version }}
32-
- name: Install the code linting and formatting tool Ruff
33-
run: |
34-
pipx install ruff
34+
3535
- name: Lint with Ruff
3636
run: |
37-
ruff check --output-format=github .
38-
- name: Installation
37+
uvx ruff check --output-format=github .
38+
39+
- name: Set up Python ${{ matrix.python-version }}
3940
run: |
40-
poetry install
41+
uv python install
42+
43+
- name: Install the project
44+
run: |
45+
uv sync --all-extras
46+
4147
- name: Test with example.csv
4248
run: |
43-
poetry run schwab2pp example.csv -p test.csv
49+
uv run schwab2pp example.csv -p test.csv
4450
diff example_out.csv test.csv

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12

README.md

Lines changed: 67 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# A Charles Schwab CSV Converter for Portfolio Performance
22

33
[![Testing badge](https://github.com/rlan/convert-csv-schwab2pp/actions/workflows/python-app.yml/badge.svg)](https://github.com/rlan/convert-csv-schwab2pp/actions)
4-
![Python versions](https://img.shields.io/badge/python-3.7%20%7C%203.8%20%7C%203.9%20%7C%203.10%20%7C%203.11%20%7C%203.12%20%7C%203.13-blue)
4+
![Python versions](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11%20%7C%203.12%20%7C%203.13-blue)
5+
[![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)
56
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
67
![MIT license](https://img.shields.io/github/license/rlan/convert-csv-schwab2pp)
78
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.15024607.svg)](https://doi.org/10.5281/zenodo.15024607)
@@ -20,18 +21,26 @@ After conversion, this [step-by-step guide](./guide/README.md) creates a new por
2021

2122
## Installation
2223

23-
First, install [pipx](https://github.com/pypa/pipx) (not pip).
24+
First, install [uv](https://github.com/astral-sh/uv).
2425

2526
Then:
2627

2728
```sh
28-
pipx install git+https://github.com/rlan/convert-csv-schwab2pp
29+
uv tool install git+https://github.com/rlan/convert-csv-schwab2pp
2930
```
3031

32+
Verify installation:
3133

32-
### Try it out!
34+
```sh
35+
uv tool list
36+
```
3337

34-
Let's see if installation was successful:
38+
```txt
39+
schwab2pp v1.0.0
40+
- schwab2pp
41+
```
42+
43+
### Try it out!
3544

3645
```sh
3746
schwab2pp --help
@@ -54,8 +63,8 @@ optional arguments:
5463

5564
Example:
5665

57-
An example Schwab CSV: [example.csv](example.csv).
58-
The converted ready-to-import CSV file: [example_out.csv](example_out.csv).
66+
- An example Schwab CSV: [example.csv](example.csv).
67+
- The converted ready-to-import CSV file: [example_out.csv](example_out.csv).
5968

6069
To replicate this conversion:
6170

@@ -67,35 +76,35 @@ schwab2pp example.csv -p example_out.csv
6776
### Update to a new version
6877

6978
```sh
70-
pipx upgrade schwab2pp
79+
uv tool upgrade schwab2pp
7180
```
7281

7382

7483
### Uninstallation
7584

7685
```sh
77-
pipx uninstall schwab2pp
86+
uv tool uninstall schwab2pp
7887
```
7988

8089

8190
## Details
8291

8392
Supported transactions:
8493

85-
* "NRA Tax Adj"
86-
* "Credit Interest"
87-
* "NRA Withholding"
88-
* "Short Term Cap Gain"
89-
* "Long Term Cap Gain"
90-
* "Cash Dividend"
91-
* "Buy"
92-
* "Wire Received"
93-
* "Wire Sent"[^1] (Thank you, [@ipaulo](https://github.com/ipaulo))
94-
* "Sell" (Not verified)
94+
- "NRA Tax Adj"
95+
- "Credit Interest"
96+
- "NRA Withholding"
97+
- "Short Term Cap Gain"
98+
- "Long Term Cap Gain"
99+
- "Cash Dividend"
100+
- "Buy"
101+
- "Wire Received"
102+
- "Wire Sent"[^1] (Thank you, [@ipaulo](https://github.com/ipaulo))
103+
- "Sell" (Not verified)
95104

96105
Not-yet-supported transactions:
97106

98-
* ACH deposit and withdrawal
107+
- ACH deposit and withdrawal
99108

100109
I have actual transactions for the supported transactions. "Sell" is an educated guess; I don't have an actual sale. If you could share actual transactions for not-yet-supported ones, please let me know. Thank you.
101110

@@ -108,6 +117,44 @@ Dates:
108117
If date is in "date1 as of date2" format, "date1" will be used and "as of date2" will be appended to the resulting "Note" column.
109118

110119

120+
## Development
121+
122+
Development is on the `develop` branch. Please send PR there.
123+
124+
How to set up the development environment:
125+
126+
- Install [uv](https://github.com/astral-sh/uv).
127+
- Clone this repo.
128+
- Install project:
129+
130+
```sh
131+
cd convert-csv-schwab2pp
132+
git checkout develop
133+
uv sync --locked --all-extras
134+
```
135+
136+
- Edit code.
137+
138+
- Update install:
139+
140+
```sh
141+
uv sync
142+
```
143+
144+
- Run test:
145+
146+
```sh
147+
uv run schwab2pp example.csv -p test.csv
148+
diff example_out.csv test.csv
149+
```
150+
151+
- Run ruff:
152+
153+
```sh
154+
uvx ruff check
155+
uvx ruff format
156+
```
157+
111158
## Citation
112159

113160
If this project helps your research, don't hesitate to spread the word! Click on the badge below and find citation formats (e.g., BibTeX and etc) at the bottom of that page.

0 commit comments

Comments
 (0)