Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate from setup.py to pyproject.toml #490

Merged
merged 3 commits into from
Jun 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# New feature

- #489 Rope now publishes documentations to readthedocs.org (@bageljrkhanofemus)
- #490 Migrate from setup.py to pyproject.toml (@bageljrkhanofemus)

# Improvement

Expand Down
74 changes: 72 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,75 @@
[tool.black]
[project]
name = 'rope'
description = 'a python refactoring library...'
readme = 'README.rst'
requires-python = '>=3.6'
classifiers = [
'Development Status :: 4 - Beta',
'Operating System :: OS Independent',
'Environment :: X11 Applications',
'Environment :: Win32 (MS Windows)',
'Environment :: MacOS X',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)',
'Natural Language :: English',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Topic :: Software Development',
]
dynamic = ['version']
dependencies = ['pytoolconfig > 1.0.0']

[[project.authors]]
name = 'Ali Gholami Rudi'
email = 'aligrudi@users.sourceforge.net'

[project.license]
text = 'LGPL-3.0-or-later'

[project.urls]
Source = 'https://github.com/python-rope/rope'

target-version = ['py35', 'py36', 'py37', 'py38', 'py39']
[project.optional-dependencies]
dev = [
'pytest>=7.0.1',
'pytest-timeout>=2.1.0',
'build>=0.7.0',
'pytoolconfig[doc]'
]
[tool.setuptools]
packages = [
'rope',
'rope.base',
'rope.base.oi',
'rope.base.oi.type_hinting',
'rope.base.oi.type_hinting.providers',
'rope.base.oi.type_hinting.resolvers',
'rope.base.utils',
'rope.contrib',
'rope.refactor',
'rope.refactor.importutils',
]
[tool.setuptools.dynamic.version]
attr = 'rope.VERSION'

[tool.black]
target-version = [
'py36',
'py37',
'py38',
'py39',
]
include = 'rope/.*\.pyi?$'
force-exclude = 'ropetest'

[build-system]
requires = [
'setuptools',
'setuptools-scm',
]
build-backend = 'setuptools.build_meta'
87 changes: 2 additions & 85 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,86 +1,3 @@
import io
import os.path
from setuptools import setup

try:
from setuptools import setup
except ImportError:
from distutils.core import setup


classifiers = [
"Development Status :: 4 - Beta",
"Operating System :: OS Independent",
"Environment :: X11 Applications",
"Environment :: Win32 (MS Windows)",
"Environment :: MacOS X",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)",
"Natural Language :: English",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Software Development",
]


def get_long_description():
lines = io.open("README.rst", "r", encoding="utf8").read().splitlines(False)
end = lines.index("Maintainers")
return "\n" + "\n".join(lines[:end]) + "\n"


def get_version():
version = None
with io.open(
os.path.join(os.path.dirname(__file__), "rope", "__init__.py")
) as inif:
for line in inif:
if line.startswith("VERSION"):
version = line.split("=")[1].strip(" \t\"'\n")
break
return version


setup(
name="rope",
version=get_version(),
description="a python refactoring library...",
long_description=get_long_description(),
long_description_content_type="text/x-rst",
author="Ali Gholami Rudi",
author_email="aligrudi@users.sourceforge.net",
url="https://github.com/python-rope/rope",
packages=[
"rope",
"rope.base",
"rope.base.oi",
"rope.base.oi.type_hinting",
"rope.base.oi.type_hinting.providers",
"rope.base.oi.type_hinting.resolvers",
"rope.base.utils",
"rope.contrib",
"rope.contrib.autoimport",
"rope.refactor",
"rope.refactor.importutils",
],
license="LGPL-3.0-or-later",
classifiers=classifiers,
extras_require={
"doc": [
"pytoolconfig[doc]",
"sphinx>=4.5.0",
"sphinx-autodoc-typehints>=1.18.1",
"sphinx-rtd-theme>=1.0.0",
],
"dev": [
"build",
"pytest",
"pytest-timeout",
],
},
python_requires=">=3.7",
)
setup()