SBU-BMI / wsinfer

🔥 🚀 Blazingly fast pipeline for patch-based classification in whole slide images
https://wsinfer.readthedocs.io
Apache License 2.0
56 stars 9 forks source link

use pyproject.toml instead of setup.cfg #134

Closed kaczmarj closed 1 year ago

kaczmarj commented 1 year ago

PEP 621 introduced pyproject toml https://peps.python.org/pep-0621/

it seems that setup.cfg might be deprecated in the future

swaradgat19 commented 1 year ago

The toml file will be in the root folder right?

kaczmarj commented 1 year ago

Yes, in the root folder. And we will be able to remove setup.cfg and setup.py in this case.We are currently using versioneer to get the WSInfer version from git (using git tags). Pyproject will allow us to importlib or something like that to query the version. I believe the pyproject page has information on how to do that. Can you please implement that as well as you refactor to use pyproject?Best,JakubOn Jul 20, 2023, at 12:31, Swarad Gat @.***> wrote: The toml file will be in the root folder right?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

swaradgat19 commented 1 year ago

Got it. I think setuptools_scm can help get the version in the toml file

swaradgat19 commented 1 year ago

@kaczmarj - I was trying to convert the flake8 section in setup.cfg.

[flake8]
max-line-length = 88
extend-ignore = E203
exclude = wsinfer/_version.py

Converts to:

# Flake8-pyproject (https://pypi.org/project/Flake8-pyproject/)
[tool.flake8]
max-line-length = 88
extend-ignore = "E203"
exclude = "wsinfer/_version.py"

But this conversion requires installing Flake8-pyproject 1.2.3. Do I need to add this library to the dependencies?

swaradgat19 commented 1 year ago

Instead of flake8 in the dev section, would we need Flake8-pyproject 1.2.3?

kaczmarj commented 1 year ago

Good catch. Yes, add flake8-pyproject to the dev dependencies. Odd that flake8 doesn’t read the config from pyproject.Best,JakubOn Jul 20, 2023, at 15:12, Swarad Gat @.***> wrote: Instead of flake8 in the dev section, would we need Flake8-pyproject 1.2.3?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

swaradgat19 commented 1 year ago

Added the pyproject.toml file. I've opened a pull request. Should I have deleted the setup.cfg and setup.py files before?