Skip to content

Commit b3624b3

Browse files
committed
switch to uv to build project
- Updated pyproject.toml with project metadata, dependencies, and build system configuration. - Removed setup.py as it is no longer needed with the new configuration. - Modified GitHub Actions workflow to support multiple Python versions and updated installation steps.
1 parent 5be99a3 commit b3624b3

5 files changed

Lines changed: 248 additions & 16 deletions

File tree

.github/workflows/python-smoke-test.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,27 @@ jobs:
1313
build:
1414

1515
runs-on: ubuntu-latest
16+
17+
strategy:
18+
max-parallel: 1
19+
fail-fast: true
20+
matrix:
21+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
1622

1723
steps:
1824
- uses: actions/checkout@v3
19-
- name: Set up Python 3.10
20-
uses: actions/setup-python@v4
25+
- name: Install uv
26+
uses: astral-sh/setup-uv@v5
2127
with:
22-
python-version: "3.10"
28+
version: "latest"
29+
- name: Set up Python ${{ matrix.python-version }}
30+
uses: actions/setup-python@v5
31+
with:
32+
python-version: ${{ matrix.python-version }}
2333
- name: Install dependencies
24-
run: |
25-
python -m pip install --upgrade pip
26-
pip install -e .
34+
run: uv sync
2735
- name: Run smoke test
2836
env:
2937
FREESOUND_API_KEY: ${{ secrets.FREESOUND_API_KEY }}
3038
run: |
31-
python examples.py
39+
uv run python examples.py

.gitignore

Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,198 @@
11
build
22
*.pyc
33
*.bak
4+
5+
# General
6+
.DS_Store
7+
.AppleDouble
8+
.LSOverride
9+
10+
# Icon must end with two \r
11+
Icon
12+
13+
14+
# Thumbnails
15+
._*
16+
17+
# Files that might appear in the root of a volume
18+
.DocumentRevisions-V100
19+
.fseventsd
20+
.Spotlight-V100
21+
.TemporaryItems
22+
.Trashes
23+
.VolumeIcon.icns
24+
.com.apple.timemachine.donotpresent
25+
26+
# Directories potentially created on remote AFP share
27+
.AppleDB
28+
.AppleDesktop
29+
Network Trash Folder
30+
Temporary Items
31+
.apdisk
32+
33+
# Byte-compiled / optimized / DLL files
34+
__pycache__/
35+
*.py[cod]
36+
*$py.class
37+
38+
# C extensions
39+
*.so
40+
41+
# Distribution / packaging
42+
.Python
43+
build/
44+
develop-eggs/
45+
dist/
46+
downloads/
47+
eggs/
48+
.eggs/
49+
lib/
50+
lib64/
51+
parts/
52+
sdist/
53+
var/
54+
wheels/
55+
share/python-wheels/
56+
*.egg-info/
57+
.installed.cfg
58+
*.egg
59+
MANIFEST
60+
61+
# PyInstaller
62+
# Usually these files are written by a python script from a template
63+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
64+
*.manifest
65+
*.spec
66+
67+
# Installer logs
68+
pip-log.txt
69+
pip-delete-this-directory.txt
70+
71+
# Unit test / coverage reports
72+
htmlcov/
73+
.tox/
74+
.nox/
75+
.coverage
76+
.coverage.*
77+
.cache
78+
nosetests.xml
79+
coverage.xml
80+
*.cover
81+
*.py,cover
82+
.hypothesis/
83+
.pytest_cache/
84+
cover/
85+
86+
# Translations
87+
*.mo
88+
*.pot
89+
90+
# Django stuff:
91+
*.log
92+
local_settings.py
93+
db.sqlite3
94+
db.sqlite3-journal
95+
96+
# Flask stuff:
97+
instance/
98+
.webassets-cache
99+
100+
# Scrapy stuff:
101+
.scrapy
102+
103+
# Sphinx documentation
104+
docs/_build/
105+
106+
# PyBuilder
107+
.pybuilder/
108+
target/
109+
110+
# Jupyter Notebook
111+
.ipynb_checkpoints
112+
113+
# IPython
114+
profile_default/
115+
ipython_config.py
116+
117+
# pyenv
118+
# For a library or package, you might want to ignore these files since the code is
119+
# intended to run in multiple environments; otherwise, check them in:
120+
# .python-version
121+
122+
# pipenv
123+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
124+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
125+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
126+
# install all needed dependencies.
127+
#Pipfile.lock
128+
129+
# poetry
130+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
131+
# This is especially recommended for binary packages to ensure reproducibility, and is more
132+
# commonly ignored for libraries.
133+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
134+
#poetry.lock
135+
136+
# pdm
137+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
138+
#pdm.lock
139+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
140+
# in version control.
141+
# https://pdm.fming.dev/#use-with-ide
142+
.pdm.toml
143+
144+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
145+
__pypackages__/
146+
147+
# Celery stuff
148+
celerybeat-schedule
149+
celerybeat.pid
150+
151+
# SageMath parsed files
152+
*.sage.py
153+
154+
# Environments
155+
.env
156+
.venv
157+
env/
158+
venv/
159+
ENV/
160+
env.bak/
161+
venv.bak/
162+
163+
# uv
164+
uv.lock
165+
166+
# Spyder project settings
167+
.spyderproject
168+
.spyproject
169+
170+
# Rope project settings
171+
.ropeproject
172+
173+
# mkdocs documentation
174+
/site
175+
176+
# mypy
177+
.mypy_cache/
178+
.dmypy.json
179+
dmypy.json
180+
181+
# Pyre type checker
182+
.pyre/
183+
184+
# pytype static type analyzer
185+
.pytype/
186+
187+
# Cython debug symbols
188+
cython_debug/
189+
190+
# PyCharm
191+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
192+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
193+
# and can be added to the global gitignore or merged into this file. For a more nuclear
194+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
195+
.idea/
196+
197+
198+
tmp/

.python-version

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

pyproject.toml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,40 @@
1+
[project]
2+
name = "freesound"
3+
version = "1.1"
4+
description = "A Python client for the Freesound APIv2"
5+
readme = "Readme.md"
6+
requires-python = ">=3.7"
7+
license = {file = "COPYING.txt"}
8+
dependencies = [
9+
"requests>=2.27,<3.0",
10+
]
11+
classifiers = [
12+
"Development Status :: 5 - Production/Stable",
13+
"Intended Audience :: Developers",
14+
"License :: OSI Approved :: MIT License",
15+
"Programming Language :: Python :: 3",
16+
"Programming Language :: Python :: 3.7",
17+
"Programming Language :: Python :: 3.8",
18+
"Programming Language :: Python :: 3.9",
19+
"Programming Language :: Python :: 3.10",
20+
"Programming Language :: Python :: 3.11",
21+
"Programming Language :: Python :: 3.12",
22+
"Programming Language :: Python :: 3.13",
23+
"Topic :: Multimedia :: Sound/Audio",
24+
]
25+
26+
[project.urls]
27+
Homepage = "https://github.com/MTG/freesound-python"
28+
Repository = "https://github.com/MTG/freesound-python.git"
29+
30+
31+
[build-system]
32+
requires = ["hatchling >= 1.26"]
33+
build-backend = "hatchling.build"
34+
35+
[tool.hatch.build]
36+
include = ["freesound.py"]
37+
138
[tool.yapf]
239
based_on_style = "google"
340
spaces_before_comment = 4

setup.py

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

0 commit comments

Comments
 (0)