Skip to content

Commit d6ec3a8

Browse files
authored
Merge pull request #316 from dpguthrie/feat/uv
Updates for 2.4.0
2 parents 57a73fc + f98127d commit d6ec3a8

31 files changed

+3210
-4904
lines changed

.flake8

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

.github/workflows/build.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,21 @@
11
name: Build
22

33
on:
4-
pull_request_target:
4+
pull_request:
55
branches: [master]
66

77
jobs:
88
build:
99
runs-on: ubuntu-latest
10-
1110
steps:
12-
- uses: actions/checkout@v3
13-
- name: Set up Python 3.9
14-
uses: actions/setup-python@v3
11+
- uses: actions/checkout@v4
12+
- name: Install uv
13+
uses: astral-sh/setup-uv@v5
1514
with:
16-
python-version: "3.9"
15+
version: "0.7.3"
1716
- name: Install dependencies
18-
run: |
19-
python -m pip install --upgrade pip
20-
pip install poetry
21-
make install_dev
17+
run: uv sync --all-extras
2218
- name: Run tests and coverage
23-
run: make test_cov
19+
run: uv run pytest tests/ -k "not test_research.py"
2420
- name: Upload coverage to Codecov
2521
uses: codecov/codecov-action@v2

.github/workflows/docs.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@ on:
55
jobs:
66
deploy:
77
runs-on: ubuntu-latest
8+
89
steps:
9-
- uses: actions/checkout@v2
10-
- uses: actions/setup-python@v2
10+
- uses: actions/checkout@v4
11+
12+
- name: Install uv
13+
uses: astral-sh/setup-uv@v5
1114
with:
12-
python-version: 3.x
13-
- run: pip install mkdocs-material "mkdocstrings[python]" mike
14-
- run: mkdocs gh-deploy --force
15+
# Install a specific version of uv.
16+
version: "0.7.3"
17+
- run: uv pip install mkdocs-material "mkdocstrings[python]" mike
18+
- run: uv run mkdocs gh-deploy --force

.github/workflows/publish.yml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1-
name: Publish Yahooquery
1+
name: Publish
2+
23
on:
3-
push:
4-
tags:
5-
- "v*.*.*"
4+
release:
5+
types: [created]
6+
67
jobs:
7-
build:
8+
deploy:
89
runs-on: ubuntu-latest
10+
911
steps:
10-
- uses: actions/checkout@v3
11-
- name: Build and publish to pypi
12-
uses: JRubics/[email protected]
13-
with:
14-
pypi_token: ${{ secrets.PYPI_KEY }}
12+
- uses: actions/checkout@v4
13+
14+
- name: Install uv
15+
uses: astral-sh/setup-uv@v3
16+
17+
- name: Build and publish
18+
run: |
19+
uv build
20+
uv publish

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ coverage.xml
4949
*.cover
5050
.hypothesis/
5151
.pytest_cache/
52+
.ruff_cache/
5253

5354
# Translations
5455
*.mo

.isort.cfg

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

.pre-commit-config.yaml

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,11 @@ default_language_version:
44
repos:
55
- repo: local
66
hooks:
7-
- id: isort
8-
stages: [commit,push]
9-
name: isort
10-
entry: poetry run isort -rc
11-
language: system
12-
types: [python]
13-
- id: black
14-
stages: [commit,push]
15-
name: black
16-
entry: poetry run black -S .
17-
language: system
18-
types: [python]
19-
- id: mypy
20-
stages: [commit,push]
21-
name: mypy
22-
entry: poetry run mypy --ignore-missing-imports
23-
language: system
24-
types: [python]
7+
- repo: https://github.com/astral-sh/ruff-pre-commit
8+
rev: v0.11.9
9+
hooks:
10+
- id: ruff
11+
- id: ruff-format
2512
- repo: https://github.com/pre-commit/pre-commit-hooks
2613
rev: v2.1.0
2714
hooks:

CHANGELOG.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
Change Log
22
==========
33

4+
2.4.0
5+
-----
6+
## Update
7+
- Update to use uv for packaging and publishing
8+
- Folder, file structure
9+
- `validate_symbols` method now returns a tuple of valid and invalid symbols
10+
11+
## Add
12+
- `curl_cffi` to dependencies instead of `requests` for session management
13+
- Ability to input verification code for login when selenium is used
14+
415
2.3.7
516
-----
617
## Add

Makefile

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
1-
PYTEST=poetry run pytest
1+
PYTEST=uv run pytest
22

33
install_dev:
4-
poetry install
4+
uv sync --all-extras
55

66
install:
7-
poetry install --no-dev
7+
uv sync
88

99
lint:
10-
poetry run black -S --check --diff .
11-
poetry run isort --check-only --diff .
12-
poetry run flake8 .
13-
poetry run mypy . --ignore-missing-imports
10+
ruff check
1411

1512
test: lint
1613
$(PYTEST)

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
<em>Python wrapper for an unofficial Yahoo Finance API</em>
66
</p>
77
<p align="center">
8-
<a href="https://travis-ci.com/dpguthrie/yahooquery" target="_blank">
9-
<img src="https://travis-ci.com/dpguthrie/yahooquery.svg?branch=master" alt="Build Status">
10-
</a>
118
<a href="https://codecov.io/gh/dpguthrie/yahooquery" target="_blank">
129
<img src="https://img.shields.io/codecov/c/github/dpguthrie/yahooquery" alt="Coverage">
1310
</a>
@@ -44,7 +41,7 @@ Some features of yahooquery:
4441

4542
## Requirements
4643

47-
Python 2.7, 3.5+
44+
Python 3.9+ - **Versions on or after 2.4.0 require python 3.9+**
4845

4946
- [Pandas](https://pandas.pydata.org) - Fast, powerful, flexible and easy to use open source data analysis and manipulation tool
5047
- [Requests](https://requests.readthedocs.io/en/master/) - The elegant and simple HTTP library for Python, built for human beings.
@@ -70,6 +67,11 @@ Otherwise, omit the premium argument:
7067
pip install yahooquery
7168
```
7269

70+
You can also install with uv if you have that installed:
71+
```bash
72+
uv pip install yahooquery
73+
```
74+
7375
## Example
7476

7577
The majority of the data available through the unofficial Yahoo Finance API is related to a company, which is represented in yahooquery as a `Ticker`. You can instantiate the `Ticker` class by passing the company's ticker symbol. For instance, to get data for Apple, Inc., pass `aapl` as the first argument to the `Ticker` class:

0 commit comments

Comments
 (0)