From ca79008d87e0c5ab0aa1b443fee0b4ab223da5b4 Mon Sep 17 00:00:00 2001 From: Miles Wells Date: Fri, 8 Nov 2024 15:39:13 +0200 Subject: [PATCH 1/2] convert to pyproject --- pyproject.toml | 21 ++++++++++++++++++++ setup.py | 52 -------------------------------------------------- 2 files changed, 21 insertions(+), 52 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..c20bb594 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,21 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "ONE-api" +dynamic = ["version", "readme", "dependencies"] +description = "Open Neurophysiology Environment" +authors = [ + {name = "IBL Staff"}, +] +requires-python = ">=3.7" +license = {text = "MIT"} + +[project.urls] +Homepage = "https://github.com/int-brain-lab/ONE" + +[tool.setuptools.dynamic] +version = {attr = "one.__version__"} +readme = {file = ["README.md"], content-type = "text/markdown"} +dependencies = {file = ["requirements.txt"]} \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 84f1cc89..00000000 --- a/setup.py +++ /dev/null @@ -1,52 +0,0 @@ -from setuptools import setup, find_packages -import sys -from pathlib import Path - -CURRENT_DIRECTORY = Path(__file__).parent.absolute() - -CURRENT_PYTHON = sys.version_info[:2] -REQUIRED_PYTHON = (3, 10) -if CURRENT_PYTHON < REQUIRED_PYTHON: - sys.stderr.write(""" -========================== -Unsupported Python version -========================== -This version of ONE requires Python {}.{}, but you're trying to -install it on Python {}.{}. -""".format(*(REQUIRED_PYTHON + CURRENT_PYTHON))) - sys.exit(1) - -with open('README.md', 'r') as f: - long_description = f.read() - -with open('requirements.txt') as f: - require = [x.strip() for x in f.readlines() if not x.startswith('git+')] - - -def get_version(rel_path): - here = Path(__file__).parent.absolute() - with open(here.joinpath(rel_path), 'r') as fp: - for line in fp.read().splitlines(): - if line.startswith('__version__'): - delim = '"' if '"' in line else "'" - return line.split(delim)[1] - raise RuntimeError('Unable to find version string.') - - -setup( - name='ONE-api', - version=get_version(Path('one', '__init__.py')), - python_requires='>={}.{}'.format(*REQUIRED_PYTHON), - description='Open Neurophysiology Environment', - license="MIT", - long_description=long_description, - long_description_content_type='text/markdown', - author='IBL Staff', - url="https://github.com/int-brain-lab/ONE", - packages=find_packages(exclude=['one.tests*']), # same as name - include_package_data=False, - # external packages as dependencies - install_requires=require, - entry_points={}, - scripts={}, -) From a104c10aa9f5d16fea5cfae1d411e06b02cc043b Mon Sep 17 00:00:00 2001 From: Miles Wells Date: Fri, 8 Nov 2024 15:50:32 +0200 Subject: [PATCH 2/2] Rebase for v3 release; added URLs; exclude tests from build --- CHANGELOG.md | 5 +++++ pyproject.toml | 12 ++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 512aa619..aed5ba49 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,11 @@ This version drops support for python 3.9 and below, and ONE is now in remote mo - one.alf.cache.remove_cache_table_files and One.\_remove_cache_table_files for deleting cache table files - one.alf.cache.EMPTY_DATASETS_FRAME and EMPTY_SESSION_FRAME vars for table column, index, and dtype template +- pyproject.toml replaces deprecated setup file + +### Removed + +- setup.py ## [2.11.1] diff --git a/pyproject.toml b/pyproject.toml index c20bb594..7ef4f34a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,13 +9,21 @@ description = "Open Neurophysiology Environment" authors = [ {name = "IBL Staff"}, ] -requires-python = ">=3.7" +requires-python = ">=3.10" license = {text = "MIT"} [project.urls] Homepage = "https://github.com/int-brain-lab/ONE" +Documentation = "https://one.internationalbrainlab.org" +Repository = "https://github.com/int-brain-lab/ONE.git" +Issues = "https://github.com/int-brain-lab/ONE/issues" +Changelog = "https://github.com/int-brain-lab/ONE/blob/main/CHANGELOG.md" [tool.setuptools.dynamic] version = {attr = "one.__version__"} readme = {file = ["README.md"], content-type = "text/markdown"} -dependencies = {file = ["requirements.txt"]} \ No newline at end of file +dependencies = {file = ["requirements.txt"]} + +[tool.setuptools.packages.find] +include = ["one*"] +exclude = ["one.tests*"]