Skip to content

Commit

Permalink
🚑 Fix package directory error.
Browse files Browse the repository at this point in the history
  • Loading branch information
BalconyJH committed Nov 17, 2024
1 parent 6b10653 commit 7ae3947
Show file tree
Hide file tree
Showing 23 changed files with 70 additions and 416 deletions.
108 changes: 54 additions & 54 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
name: Code Coverage

on:
push:
branches:
- master
pull_request:
paths:
- "envs/**"
- "src/**"
- "tests/**"
- ".github/workflows/codecov.yml"
- "pyproject.toml"
- "pdm.lock"

jobs:
test:
name: Test Coverage
runs-on: ${{ matrix.os }}
concurrency:
group: test-coverage-${{ github.ref }}-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.env }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, windows-latest, macos-latest]
env:
OS: ${{ matrix.os }}
PYTHON_VERSION: ${{ matrix.python-version }}

steps:
- uses: actions/checkout@v4

- name: Setup Python environment
uses: ./.github/actions/setup-python
with:
python-version: ${{ matrix.python-version }}
env-dir: ./envs/${{ matrix.env }}
no-root: true

- name: Run Pytest
run: |
cd ./envs/${{ matrix.env }}
poetry run bash "../../scripts/run-tests.sh"
- name: Upload coverage report
uses: codecov/codecov-action@v4
with:
env_vars: OS,PYTHON_VERSION,PYDANTIC_VERSION
files: ./tests/coverage.xml
flags: unittests
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
#name: Code Coverage
#
#on:
# push:
# branches:
# - main
# pull_request:
# paths:
# - "envs/**"
# - "aioarxiv/**"
# - "tests/**"
# - ".github/workflows/codecov.yml"
# - "pyproject.toml"
# - "pdm.lock"
#
#jobs:
# test:
# name: Test Coverage
# runs-on: ${{ matrix.os }}
# concurrency:
# group: test-coverage-${{ github.ref }}-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.env }}
# cancel-in-progress: true
# strategy:
# fail-fast: false
# matrix:
# python-version: ["3.9", "3.10", "3.11", "3.12"]
# os: [ubuntu-latest, windows-latest, macos-latest]
# env:
# OS: ${{ matrix.os }}
# PYTHON_VERSION: ${{ matrix.python-version }}
#
# steps:
# - uses: actions/checkout@v4
#
# - name: Setup Python environment
# uses: ./.github/actions/setup-python
# with:
# python-version: ${{ matrix.python-version }}
# env-dir: ./envs/${{ matrix.env }}
# no-root: true
#
# - name: Run Pytest
# run: |
# cd ./envs/${{ matrix.env }}
# poetry run bash "../../scripts/run-tests.sh"
#
# - name: Upload coverage report
# uses: codecov/codecov-action@v4
# with:
# env_vars: OS,PYTHON_VERSION,PYDANTIC_VERSION
# files: ./tests/coverage.xml
# flags: unittests
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/pyright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ name: Pyright Lint
on:
push:
branches:
- master
- main
pull_request:
paths:
- "envs/**"
- "src/**"
- "aioarxiv/**"
- "tests/**"
- ".github/actions/setup-python/**"
- ".github/workflows/pyright.yml"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ name: Ruff Lint
on:
push:
branches:
- master
- main
pull_request:
paths:
- "envs/**"
- "src/**"
- "aioarxiv/**"
- "tests/**"
- ".github/actions/setup-python/**"
- ".github/workflows/ruff.yml"
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,19 @@ pip install aioarxiv
import asyncio
from aioarxiv import ArxivClient


async def main():
async with ArxivClient() as client:
async for paper in client.search("quantum computing", max_results=1):
print(f"Title: {paper.title}")
print(f"Authors: {', '.join(a.name for a in paper.authors)}")
print(f"Summary: {paper.summary[:200]}...")

# Download PDF
file_path = await client.download_paper(paper)
print(f"Downloaded to: {file_path}")


if __name__ == "__main__":
asyncio.run(main())
```
Expand All @@ -44,9 +46,9 @@ if __name__ == "__main__":
from aioarxiv import ArxivConfig, ArxivClient

config = ArxivConfig(
rate_limit_calls=3, # Rate limit per window
rate_limit_period=1.0, # Window period in seconds
max_concurrent_requests=3 # Max concurrent requests
rate_limit_calls=3, # Rate limit per window
rate_limit_period=1.0, # Window period in seconds
max_concurrent_requests=3 # Max concurrent requests
)

client = ArxivClient(config=config)
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ line_length = 88
length_sort = true
skip_gitignore = true
force_sort_within_sections = true
src_paths = ["src", "tests"]
src_paths = ["aioarxiv", "tests"]
extra_standard_library = ["typing_extensions"]

[tool.ruff]
Expand Down Expand Up @@ -82,7 +82,7 @@ executionEnvironments = [
{ root = "./tests", extraPaths = [
"./",
] },
{ root = "./src" },
{ root = "./" },
]
typeCheckingMode = "standard"
disableBytesTypePromotions = true
Expand Down
File renamed without changes.
Empty file added src/aioarxiv/client/__init__.py
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 7ae3947

Please sign in to comment.