Skip to content

Commit

Permalink
add pyproject.toml and setup.cfg, remove setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
craigahobbs committed Oct 31, 2022
1 parent 6891ab9 commit 781a982
Show file tree
Hide file tree
Showing 22 changed files with 200 additions and 300 deletions.
4 changes: 2 additions & 2 deletions template/doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
# The full version, including alpha/beta/rc tags
import os
import re
with open(os.path.join(os.path.abspath(os.path.dirname(__file__)), '..', 'setup.py'), encoding='utf-8') as init_file:
release = re.search(r"version='(.+?)'", init_file.read()).group(1)
with open(os.path.join(os.path.abspath(os.path.dirname(__file__)), '..', 'setup.cfg'), encoding='utf-8') as init_file:
release = re.search(r"version\s*=\s*(\S+)", init_file.read()).group(1)


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions template/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build-system]
requires = ["setuptools", "wheel"]
36 changes: 36 additions & 0 deletions template/setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[metadata]
name = {{package}}
version = 0.9.0
url = https://github.com/{{github}}/{{package}}
author = {{name}}
author_email = {{email}}
license = MIT
description = {{package}}
{% if noapi is defined and noapi -%}
long_description = file:README.md
long_description_content_type = text/markdown; charset=UTF-8
{% else -%}
long_description = file:README.rst
{% endif -%}
keywords = {{package}}
classifiers =
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
License :: OSI Approved :: MIT License
Operating System :: OS Independent
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Topic :: Utilities

[options]
packages = {{package | replace("-", "_")}}
package_dir =
= src
{% if nomain is not defined or not nomain %}
[options.entry_points]
console_scripts =
{{package}} = {{package | replace("-", "_")}}.main:main
{% endif -%}
51 changes: 0 additions & 51 deletions template/setup.py

This file was deleted.

4 changes: 2 additions & 2 deletions test-expected/noapi-0-nomain-0/doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
# The full version, including alpha/beta/rc tags
import os
import re
with open(os.path.join(os.path.abspath(os.path.dirname(__file__)), '..', 'setup.py'), encoding='utf-8') as init_file:
release = re.search(r"version='(.+?)'", init_file.read()).group(1)
with open(os.path.join(os.path.abspath(os.path.dirname(__file__)), '..', 'setup.cfg'), encoding='utf-8') as init_file:
release = re.search(r"version\s*=\s*(\S+)", init_file.read()).group(1)


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions test-expected/noapi-0-nomain-0/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build-system]
requires = ["setuptools", "wheel"]
30 changes: 30 additions & 0 deletions test-expected/noapi-0-nomain-0/setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[metadata]
name = my-package
version = 0.9.0
url = https://github.com/johndoe/my-package
author = John Doe
author_email = [email protected]
license = MIT
description = my-package
long_description = file:README.rst
keywords = my-package
classifiers =
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
License :: OSI Approved :: MIT License
Operating System :: OS Independent
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Topic :: Utilities

[options]
packages = my_package
package_dir =
= src

[options.entry_points]
console_scripts =
my-package = my_package.main:main
51 changes: 0 additions & 51 deletions test-expected/noapi-0-nomain-0/setup.py

This file was deleted.

2 changes: 2 additions & 0 deletions test-expected/noapi-nomain/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build-system]
requires = ["setuptools", "wheel"]
27 changes: 27 additions & 0 deletions test-expected/noapi-nomain/setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[metadata]
name = my-package
version = 0.9.0
url = https://github.com/johndoe/my-package
author = John Doe
author_email = [email protected]
license = MIT
description = my-package
long_description = file:README.md
long_description_content_type = text/markdown; charset=UTF-8
keywords = my-package
classifiers =
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
License :: OSI Approved :: MIT License
Operating System :: OS Independent
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Topic :: Utilities

[options]
packages = my_package
package_dir =
= src
44 changes: 0 additions & 44 deletions test-expected/noapi-nomain/setup.py

This file was deleted.

2 changes: 2 additions & 0 deletions test-expected/noapi/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build-system]
requires = ["setuptools", "wheel"]
31 changes: 31 additions & 0 deletions test-expected/noapi/setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[metadata]
name = my-package
version = 0.9.0
url = https://github.com/johndoe/my-package
author = John Doe
author_email = [email protected]
license = MIT
description = my-package
long_description = file:README.md
long_description_content_type = text/markdown; charset=UTF-8
keywords = my-package
classifiers =
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
License :: OSI Approved :: MIT License
Operating System :: OS Independent
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Topic :: Utilities

[options]
packages = my_package
package_dir =
= src

[options.entry_points]
console_scripts =
my-package = my_package.main:main
49 changes: 0 additions & 49 deletions test-expected/noapi/setup.py

This file was deleted.

4 changes: 2 additions & 2 deletions test-expected/nomain/doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
# The full version, including alpha/beta/rc tags
import os
import re
with open(os.path.join(os.path.abspath(os.path.dirname(__file__)), '..', 'setup.py'), encoding='utf-8') as init_file:
release = re.search(r"version='(.+?)'", init_file.read()).group(1)
with open(os.path.join(os.path.abspath(os.path.dirname(__file__)), '..', 'setup.cfg'), encoding='utf-8') as init_file:
release = re.search(r"version\s*=\s*(\S+)", init_file.read()).group(1)


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions test-expected/nomain/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build-system]
requires = ["setuptools", "wheel"]
Loading

0 comments on commit 781a982

Please sign in to comment.