Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install uv and install packages #732

Merged
merged 11 commits into from
Dec 20, 2024
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
42 changes: 21 additions & 21 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,17 @@ jobs:
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
- name: Install dependencies and activate venv
run: |
sudo apt install libsndfile1
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi
sudo apt-get install libsndfile1
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv --python ${{ matrix.python-version }}
source .venv/bin/activate
uv sync
- name: Lint with flake8
run: |
source .venv/bin/activate

# stop the build if there are Python syntax errors or undefined names
flake8 tensorboardX --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
Expand All @@ -39,6 +38,7 @@ jobs:
MPLBACKEND: Agg
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION: python
run: |
source .venv/bin/activate
visdom &
pytest --cov=tensorboardX tests/

Expand All @@ -50,13 +50,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Run examples
run: |
pip install six tensorboard pytest matplotlib torchvision protobuf==4.22.3 moviepy==1.0.3 imageio==2.27
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv --python 3.9
source .venv/bin/activate
uv pip install six tensorboard pytest matplotlib torchvision protobuf==4.22.3 moviepy==1.0.3 imageio==2.27
python examples/demo.py
python examples/demo_graph.py
python examples/demo_embedding.py
Expand All @@ -73,13 +72,14 @@ jobs:
protobuf-version: ["3.20", "4.21", "4.22", "4.23"]
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.11
uses: actions/setup-python@v2
with:
python-version: 3.11
- name: Run examples
- name: Install python 3.11
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv --python 3.11

- name: Run basic import check
run: |
pip install numpy protobuf==${{ matrix.protobuf-version }}
source .venv/bin/activate
uv pip install numpy protobuf==${{ matrix.protobuf-version }}
python -c "import tensorboardX"


36 changes: 36 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[project]
name = "tensorboardx"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.9"
dependencies = []

[tool.uv.sources]
torch = { index = "pytorch-cpu" }
torchvision = { index = "pytorch-cpu" }

[[tool.uv.index]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true

[dependency-groups]
dev = [
"pytest-cov>=6.0.0",
"pytest>=8.3.4",
"protobuf==4.22.3",
"flake8>=7.1.1",
"torch>=2.5.1",
"torchvision>=0.20.1",
"numpy>=2.0.2",
"tensorboard>=2.18.0",
"boto3>=1.35.81",
"matplotlib>=3.9.4",
"moto<5",
"soundfile>=0.12.1",
"visdom>=0.2.4",
"onnx>=1.17.0",
"imageio==2.27",
]

Loading