From 19fc1731e2e5ad4f2176e0b69d3bfee6ff9c2361 Mon Sep 17 00:00:00 2001 From: "Alexandre G.-Raymond" Date: Mon, 12 Dec 2022 19:55:15 +0100 Subject: [PATCH 1/6] Package with Poetry --- .gitignore | 1 + Readme.md => README.md | 6 +++--- pyproject.toml | 19 +++++++++++++++++++ setup.py | 11 +++-------- 4 files changed, 26 insertions(+), 11 deletions(-) rename Readme.md => README.md (95%) create mode 100644 pyproject.toml diff --git a/.gitignore b/.gitignore index 17a8d54..18b8150 100755 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ build *.pyc *.bak +dist/ \ No newline at end of file diff --git a/Readme.md b/README.md similarity index 95% rename from Readme.md rename to README.md index 982776c..5d8787a 100644 --- a/Readme.md +++ b/README.md @@ -30,15 +30,15 @@ for sound in results: ## Installation 1) clone or download - + 2) run: ``` python setup.py install ``` -Alternatively you should also be able to install directly from GitHub with: +Alternatively you can install with pip: ``` -pip install git+https://github.com/MTG/freesound-python +pip install freesound-python ``` ## Advanced usage diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..2c4965c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,19 @@ +[tool.poetry] +name = "freesound-python" +version = "1.1.0" +description = "A Python client for the Freesound APIv2." +authors = ["Universitat Pompeu Fabra"] +maintainers = ["Frederic Font "] +license = "MIT" +readme = "README.md" +repository = "https://github.com/MTG/freesound-python" +packages = [{include = "freesound.py"}] + +[tool.poetry.dependencies] +python = "^3.6" +requests = "<3.0,>2.27" + + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" \ No newline at end of file diff --git a/setup.py b/setup.py index b2f6273..1abbd06 100644 --- a/setup.py +++ b/setup.py @@ -1,9 +1,4 @@ -from distutils.core import setup +import setuptools -setup( - name="freesound-python", - version="1.1", - py_modules=["freesound"], - install_requires=["requests<3.0,>2.27"], - python_requires=">=3.6", -) +if __name__ == "__main__": + setuptools.setup() From e998e9c384cf13b592effc3cb1af8fe81c1aa105 Mon Sep 17 00:00:00 2001 From: "Alexandre G.-Raymond" Date: Sat, 17 Dec 2022 14:03:43 +0100 Subject: [PATCH 2/6] Switch from poetry to setuptools as the build tool --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2c4965c..184e987 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,5 +15,5 @@ requests = "<3.0,>2.27" [build-system] -requires = ["poetry-core"] -build-backend = "poetry.core.masonry.api" \ No newline at end of file +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" From 9f4ce4dc53d8b8f5135ac38087bad297a8673c14 Mon Sep 17 00:00:00 2001 From: Frederic Font Date: Mon, 19 Dec 2022 12:00:23 +0100 Subject: [PATCH 3/6] Specify files to be bundled --- pyproject.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 184e987..5c1b041 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,9 @@ packages = [{include = "freesound.py"}] python = "^3.6" requests = "<3.0,>2.27" - [build-system] requires = ["setuptools>=61.0"] build-backend = "setuptools.build_meta" + +[tool.setuptools] +py-modules=["freesound"] From a4071fe3388ced3533814d3702282359e01e0bd7 Mon Sep 17 00:00:00 2001 From: Frederic Font Date: Mon, 19 Dec 2022 12:08:56 +0100 Subject: [PATCH 4/6] Remove tool.setuptools as not supported --- pyproject.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5c1b041..dd83505 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,6 +16,3 @@ requests = "<3.0,>2.27" [build-system] requires = ["setuptools>=61.0"] build-backend = "setuptools.build_meta" - -[tool.setuptools] -py-modules=["freesound"] From acebc5f3f99db2fbb8326befd773f3ab4a647239 Mon Sep 17 00:00:00 2001 From: Frederic Font Date: Mon, 19 Dec 2022 12:13:28 +0100 Subject: [PATCH 5/6] Test indicating packages in a different way --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index dd83505..4f9859a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ maintainers = ["Frederic Font "] license = "MIT" readme = "README.md" repository = "https://github.com/MTG/freesound-python" -packages = [{include = "freesound.py"}] +packages = [{include = "freesound"}] [tool.poetry.dependencies] python = "^3.6" From 570926a6d0268a6ad825d47ee6a074c9bbea9be2 Mon Sep 17 00:00:00 2001 From: Frederic Font Date: Mon, 19 Dec 2022 12:14:24 +0100 Subject: [PATCH 6/6] Revert my previous test --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 4f9859a..dd83505 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ maintainers = ["Frederic Font "] license = "MIT" readme = "README.md" repository = "https://github.com/MTG/freesound-python" -packages = [{include = "freesound"}] +packages = [{include = "freesound.py"}] [tool.poetry.dependencies] python = "^3.6"