diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 837dad5..47ede93 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -23,7 +23,7 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Setup pip - run: python -m pip install --upgrade pip setuptools wheel + run: python -m pip install --upgrade pip setuptools setuptools_scm wheel - name: Install package run: pip install .[dev] - name: Check black version diff --git a/.github/workflows/pypi.yaml b/.github/workflows/pypi.yaml index 5adc754..a9e6783 100644 --- a/.github/workflows/pypi.yaml +++ b/.github/workflows/pypi.yaml @@ -16,9 +16,9 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install setuptools wheel twine setuptools_scm[toml] + pip install setuptools wheel twine setuptools_scm[toml] build - name: Build distribution - run: python setup.py sdist bdist_wheel + run: python -m build -nwsx . - name: Publish to PyPI Test env: TWINE_USERNAME: __token__ diff --git a/pyproject.toml b/pyproject.toml index 41b4eb4..46ba9f8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,61 @@ +[build-system] +requires = ["setuptools>=61.2", "setuptools_scm[toml]>=7.0.2", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "binarytree" +authors = [{name = "Joohwan Oh", email = "joohwan.oh@outlook.com"}] +license = {text = "MIT"} +description = "Python Library for Studying Binary Trees" +readme = "README.md" +keywords = ["tree", "heap", "bst", "education"] +classifiers = [ + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Natural Language :: English", + "Operating System :: MacOS", + "Operating System :: Microsoft :: Windows", + "Operating System :: Unix", + "Programming Language :: Python :: 3", + "Topic :: Documentation :: Sphinx", + "Topic :: Education", +] +urls = {Homepage = "https://github.com/joowani/binarytree"} +requires-python = ">=3.7" +dependencies = ["graphviz"] +dynamic = ["version"] + +[project.optional-dependencies] +dev = [ + "black>=22.1.0", + "flake8>=4.0.1", + "isort>=5.10.1", + "mypy>=0.931", + "pre-commit>=2.17.0", + "pytest>=6.2.1", + "pytest-cov>=2.10.1", + "sphinx", + "sphinx_rtd_theme", + "types-setuptools", + "types-dataclasses", +] + +[tool.setuptools] +include-package-data = true + +[tool.setuptools_scm] +write_to = "binarytree/version.py" + +[tool.setuptools.packages.find] +exclude = ["tests"] +namespaces = false + +[tool.flake8] +max-line-length = "88" +extend-ignore = "E203, E741, W503" +exclude = ".git .idea .*_cache dist htmlcov venv" +per-file-ignores = "__init__.py:F401 conf.py:E402" + [tool.coverage.run] omit = ["binarytree/version.py"] @@ -9,9 +67,6 @@ addopts = "-s -vv -p no:warnings" minversion = "6.0" testpaths = ["tests"] -[tool.setuptools_scm] -write_to = "binarytree/version.py" - [tool.mypy] warn_return_any = true warn_unused_configs = true diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 04b373c..0000000 --- a/setup.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[flake8] -max-line-length = 88 -extend-ignore = E203, E741, W503 -exclude =.git .idea .*_cache dist htmlcov venv -per-file-ignores = __init__.py:F401 conf.py:E402 diff --git a/setup.py b/setup.py deleted file mode 100644 index b9260a0..0000000 --- a/setup.py +++ /dev/null @@ -1,52 +0,0 @@ -from setuptools import find_packages, setup - -with open("README.md") as fp: - description = fp.read() - -setup( - name="binarytree", - description="Python Library for Studying Binary Trees", - long_description=description, - long_description_content_type="text/markdown", - author="Joohwan Oh", - author_email="joohwan.oh@outlook.com", - url="https://github.com/joowani/binarytree", - keywords=["tree", "heap", "bst", "education"], - packages=find_packages(exclude=["tests"]), - include_package_data=True, - python_requires=">=3.7", - license="MIT", - use_scm_version=True, - setup_requires=["setuptools_scm"], - install_requires=[ - "graphviz", - "setuptools>=60.8.2", - "setuptools_scm[toml]>=5.0.1", - ], - extras_require={ - "dev": [ - "black>=22.1.0", - "flake8>=4.0.1", - "isort>=5.10.1", - "mypy>=0.931", - "pre-commit>=2.17.0", - "pytest>=6.2.1", - "pytest-cov>=2.10.1", - "sphinx", - "sphinx_rtd_theme", - "types-setuptools", - "types-dataclasses", - ], - }, - classifiers=[ - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Natural Language :: English", - "Operating System :: MacOS", - "Operating System :: Microsoft :: Windows", - "Operating System :: Unix", - "Programming Language :: Python :: 3", - "Topic :: Documentation :: Sphinx", - "Topic :: Education", - ], -)