diff --git a/.github/workflows/nightly-wheel-build.yml b/.github/workflows/nightly-wheel-build.yml index 03a222b..b1e242c 100644 --- a/.github/workflows/nightly-wheel-build.yml +++ b/.github/workflows/nightly-wheel-build.yml @@ -20,7 +20,7 @@ jobs: python-version: "3.10" cache: pip cache-dependency-path: | - setup.cfg + pyproject.toml - name: Try building with Python build if: runner.os != 'Windows' # setup.py does not support sdist on Windows run: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6c354e6..4d87bf4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -56,7 +56,7 @@ jobs: python-version: ${{ matrix.python-version }} cache: pip cache-dependency-path: | - setup.cfg + pyproject.toml - name: Install latex if: runner.os == 'Linux' && matrix.deps == 'test_extra' run: echo "disable latex for now, issues in mirros" #sudo apt-get -yq -o Acquire::Retries=3 --no-install-suggests --no-install-recommends install texlive dvipng diff --git a/MANIFEST.in b/MANIFEST.in index 8f97280..9a974c4 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -4,7 +4,6 @@ include LICENSE include setupbase.py include _build_meta.py include MANIFEST.in -include py.typed include .mailmap include .flake8 include .pre-commit-config.yaml diff --git a/pyproject.toml b/pyproject.toml index 6cd5c98..ad0ab87 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,108 @@ [build-system] -requires = ["setuptools >= 51.0.0"] +requires = ["setuptools>=61.2"] # We need access to the 'setupbase' module at build time. # Hence we declare a custom build backend. build-backend = "_build_meta" # just re-exports setuptools.build_meta definitions backend-path = ["."] +[project] +name = "ipython" +description = "IPython: Productive Interactive Computing" +keywords = ["Interactive", "Interpreter", "Shell", "Embedding"] +classifiers = [ + "Framework :: IPython", + "Framework :: Jupyter", + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: BSD License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Topic :: System :: Shells", +] +requires-python = ">=3.10" +dependencies = [ + 'colorama; sys_platform == "win32"', + "decorator", + "exceptiongroup; python_version<'3.11'", + "jedi>=0.16", + "matplotlib-inline", + 'pexpect>4.3; sys_platform != "win32" and sys_platform != "emscripten"', + "prompt_toolkit>=3.0.41,<3.1.0", + "pygments>=2.4.0", + "stack_data", + "traitlets>=5", + "typing_extensions; python_version<'3.10'", +] +dynamic = ["authors", "entry-points", "license", "scripts", "version"] + +[project.readme] +file = "long_description.rst" +content-type = "text/x-rst" + +[project.urls] +Homepage = "https://ipython.org" +Documentation = "https://ipython.readthedocs.io/" +Funding = "https://numfocus.org/" +Source = "https://github.com/ipython/ipython" +Tracker = "https://github.com/ipython/ipython/issues" + +[project.optional-dependencies] +black = [ + "black", +] +doc = [ + "ipykernel", + "setuptools>=18.5", + "sphinx>=1.3", + "sphinx-rtd-theme", + "docrepr", + "matplotlib", + "stack_data", + "typing_extensions", + "exceptiongroup", + "ipython[test]", +] +kernel = [ + "ipykernel", +] +nbconvert = [ + "nbconvert", +] +nbformat = [ + "nbformat", +] +notebook = [ + "ipywidgets", + "notebook", +] +parallel = [ + "ipyparallel", +] +qtconsole = [ + "qtconsole", +] +terminal = [] +test = [ + "pytest<8", + "pytest-asyncio<0.22", + "testpath", + "pickleshare", +] +test_extra = [ + "ipython[test]", + "curio", + "matplotlib!=3.2.0", + "nbformat", + "numpy>=1.23", + "pandas", + "trio", +] +all = [ + "ipython[black,doc,kernel,nbconvert,nbformat,notebook,parallel,qtconsole,terminal]", + "ipython[test,test_extra]", +] + [tool.mypy] python_version = "3.10" ignore_missing_imports = true @@ -76,3 +174,23 @@ asyncio_mode = "strict" [tool.pyright] pythonPlatform="All" + +[tool.setuptools] +zip-safe = false +platforms = ["Linux", "Mac OSX", "Windows"] +license-files = ["LICENSE"] +include-package-data = false + +[tool.setuptools.packages.find] +exclude = ["setupext"] +namespaces = false + +[tool.setuptools.package-data] +"IPython" = ["py.typed"] +"IPython.core" = ["profile/README*"] +"IPython.core.tests" = ["*.png", "*.jpg", "daft_extension/*.py"] +"IPython.lib.tests" = ["*.wav"] +"IPython.testing.plugin" = ["*.txt"] + +[tool.setuptools.dynamic] +version = {attr = "IPython.core.release.__version__"} diff --git a/setup.cfg b/setup.cfg index de77754..35e570d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,111 +1,3 @@ -[metadata] -name = ipython -version = attr: IPython.core.release.__version__ -url = https://ipython.org -description = IPython: Productive Interactive Computing -long_description_content_type = text/x-rst -long_description = file: long_description.rst -license_file = LICENSE -project_urls = - Documentation = https://ipython.readthedocs.io/ - Funding = https://numfocus.org/ - Source = https://github.com/ipython/ipython - Tracker = https://github.com/ipython/ipython/issues -keywords = Interactive, Interpreter, Shell, Embedding -platforms = Linux, Mac OSX, Windows -classifiers = - Framework :: IPython - Framework :: Jupyter - Intended Audience :: Developers - Intended Audience :: Science/Research - License :: OSI Approved :: BSD License - Programming Language :: Python - Programming Language :: Python :: 3 - Programming Language :: Python :: 3 :: Only - Topic :: System :: Shells - -[options] -packages = find: -python_requires = >=3.10 -zip_safe = False -install_requires = - colorama; sys_platform == "win32" - decorator - exceptiongroup; python_version<'3.11' - jedi>=0.16 - matplotlib-inline - pexpect>4.3; sys_platform != "win32" and sys_platform != "emscripten" - prompt_toolkit>=3.0.41,<3.1.0 - pygments>=2.4.0 - stack_data - traitlets>=5 - typing_extensions ; python_version<'3.10' - -[options.extras_require] -black = - black -doc = - ipykernel - setuptools>=18.5 - sphinx>=1.3 - sphinx-rtd-theme - docrepr - matplotlib - stack_data - typing_extensions - exceptiongroup - %(test)s -kernel = - ipykernel -nbconvert = - nbconvert -nbformat = - nbformat -notebook = - ipywidgets - notebook -parallel = - ipyparallel -qtconsole = - qtconsole -terminal = -test = - pytest<8 - pytest-asyncio<0.22 - testpath - pickleshare -test_extra = - %(test)s - curio - matplotlib!=3.2.0 - nbformat - numpy>=1.23 - pandas - trio -all = - %(black)s - %(doc)s - %(kernel)s - %(nbconvert)s - %(nbformat)s - %(notebook)s - %(parallel)s - %(qtconsole)s - %(terminal)s - %(test_extra)s - %(test)s - -[options.packages.find] -exclude = - setupext - -[options.package_data] -IPython = py.typed -IPython.core = profile/README* -IPython.core.tests = *.png, *.jpg, daft_extension/*.py -IPython.lib.tests = *.wav -IPython.testing.plugin = *.txt - [velin] ignore_patterns = IPython/core/tests diff --git a/setupbase.py b/setupbase.py index a867c73..06705a5 100644 --- a/setupbase.py +++ b/setupbase.py @@ -66,49 +66,10 @@ setup_args = dict( license = license, ) - -#--------------------------------------------------------------------------- -# Find packages -#--------------------------------------------------------------------------- - -def find_packages(): - """ - Find all of IPython's packages. - """ - excludes = ['deathrow', 'quarantine'] - packages = [] - for directory, subdirs, files in os.walk("IPython"): - package = directory.replace(os.path.sep, ".") - if any(package.startswith("IPython." + exc) for exc in excludes): - # package is to be excluded (e.g. deathrow) - continue - if '__init__.py' not in files: - # not a package - continue - packages.append(package) - return packages - #--------------------------------------------------------------------------- -# Find package data +# Check package data #--------------------------------------------------------------------------- -def find_package_data(): - """ - Find IPython's package_data. - """ - # This is not enough for these things to appear in an sdist. - # We need to muck with the MANIFEST to get this to work - - package_data = { - 'IPython.core' : ['profile/README*'], - 'IPython.core.tests' : ['*.png', '*.jpg', 'daft_extension/*.py'], - 'IPython.lib.tests' : ['*.wav'], - 'IPython.testing.plugin' : ['*.txt'], - } - - return package_data - - def check_package_data(package_data): """verify that package_data globs make sense""" print("checking package data")