From 7648e715f81fea1cc20af9e9eec20710163bf236 Mon Sep 17 00:00:00 2001 From: skshetry Date: Mon, 31 Oct 2022 22:43:48 +0545 Subject: [PATCH] move project config to pyproject.toml (#8493) * move config to pyproject.toml * ci: use pyproject.toml for cache key * pyproject.toml: use recursive dependencies for dev and all * Update pyproject.toml --- .flake8 | 12 +++ .github/workflows/packages.yaml | 4 +- .github/workflows/tests.yaml | 4 +- pyproject.toml | 135 +++++++++++++++++++++++++- setup.cfg | 166 -------------------------------- 5 files changed, 150 insertions(+), 171 deletions(-) create mode 100644 .flake8 delete mode 100644 setup.cfg diff --git a/.flake8 b/.flake8 new file mode 100644 index 000000000..bf51a3627 --- /dev/null +++ b/.flake8 @@ -0,0 +1,12 @@ +[flake8] +ignore= + E203, # Whitespace before ':' + E266, # Too many leading '#' for block comment + W503, # Line break occurred before a binary operator + P1, # unindexed parameters in the str.format, see: + # https://pypi.org/project/flake8-string-format/ +max_line_length = 79 +max-complexity = 15 +select = B,C,E,F,W,T4,B902,T,P +show_source = true +count = true diff --git a/.github/workflows/packages.yaml b/.github/workflows/packages.yaml index 1588289c0..750129103 100644 --- a/.github/workflows/packages.yaml +++ b/.github/workflows/packages.yaml @@ -30,7 +30,7 @@ jobs: python-version: 3.9 cache: pip cache-dependency-path: | - setup.cfg + pyproject.toml scripts/build-requirements.txt - name: Set up Ruby 2.6 @@ -78,7 +78,7 @@ jobs: with: python-version: 3.8 cache: pip - cache-dependency-path: setup.cfg + cache-dependency-path: pyproject.toml - name: Install run: | diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index d7074bdcc..179e84347 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -30,7 +30,7 @@ jobs: with: python-version: 3.8 cache: pip - cache-dependency-path: setup.cfg + cache-dependency-path: pyproject.toml - name: Install requirements run: | pip install --upgrade pip setuptools wheel @@ -62,7 +62,7 @@ jobs: with: python-version: ${{ matrix.pyv }} cache: pip - cache-dependency-path: setup.cfg + cache-dependency-path: pyproject.toml - name: install if: steps.cache.pip-cache-dir.cache-hit != 'true' run: | diff --git a/pyproject.toml b/pyproject.toml index 47454c1c9..420b3f300 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,140 @@ [build-system] -requires = ["setuptools>=48", "setuptools_scm[toml]>=7"] +requires = ["setuptools>=61", "setuptools_scm[toml]>=7"] build-backend = "setuptools.build_meta" +[project] +name = "dvc" +description = "Git for data scientists - manage your code and data together" +readme = "README.rst" +keywords = [ + "data-science", + "data-version-control", + "machine-learning", + "git", + "developer-tools", + "reproducibility", + "collaboration", + "ai", +] +license = { file = "LICENSE" } +authors = [{ name = "Dmitry Petrov", email = "dmitry@dvc.org" }] +maintainers = [{ name = "Iterative", email = "support@dvc.org" }] +requires-python = ">=3.8" +dependencies = [ + "colorama>=0.3.9", + "configobj>=5.0.6", + "voluptuous>=0.11.7", + "requests>=2.22.0", + # See https://github.com/bdcht/grandalf/issues/26 + "grandalf==0.6", + "distro>=1.3.0", + "appdirs>=1.4.3", + "ruamel.yaml>=0.17.11", + "tomlkit>=0.11.1", + "funcy>=1.14", + "pathspec>=0.9.0,<0.10.0", + "shortuuid>=0.5.0", + "tqdm>=4.63.1,<5", + "packaging>=19.0", + "zc.lockfile>=1.2.1", + "flufl.lock>=5", + "networkx>=2.5", + "psutil>=5.8.0", + "pydot>=1.2.4", + "importlib-resources>=5.2.2; python_version < '3.9'", + "flatten_dict>=0.4.1,<1", + "tabulate>=0.8.7", + "pygtrie>=2.3.2", + "dpath>=2.0.2,<3", + "shtab>=1.3.4,<2", + "rich>=10.13.0", + "pyparsing>=2.4.7", + "typing-extensions>=3.7.4", + "scmrepo==0.1.2", + "dvc-render==0.0.12", + "dvc-task==0.1.4", + "dvclive>=0.10.0", + "dvc-data==0.25.2", + "dvc-http==2.27.2", + "hydra-core>=1.1.0", + "iterative-telemetry==0.0.5", +] +dynamic = ["version"] +classifiers = [ + "Development Status :: 4 - Beta", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", +] + +[project.optional-dependencies] +azure = ["dvc-azure==2.20.4"] +gdrive = ["dvc-gdrive==2.19.0"] +gs = ["dvc-gs==2.19.1"] +hdfs = ["dvc-hdfs==2.19.0; python_version < '3.11'"] +oss = ["dvc-oss==2.19.0"] +s3 = ["dvc-s3==2.20.1"] +ssh = ["dvc-ssh==2.20.0"] +ssh_gssapi = ["dvc-ssh[gssapi]==2.20.0"] +webdav = ["dvc-webdav==2.19.0"] +webhdfs = ["dvc-webhdfs==2.19.0"] +webhdfs_kerberos = ["dvc-webhdfs[kerberos]==2.19.0"] +terraform = ["tpi[ssh]>=2.1.0"] +testing = ["pytest-test-utils==0.0.8"] +tests = [ + "tpi[ssh]>=2.1.0", + "dvc-ssh==2.20.0", + "pytest-test-utils==0.0.8", + # Test requirements + "pytest==7.2.0", + "pytest-cov==4.0.0", + "pytest-xdist==3.0.2", + "pytest-mock==3.10.0", + "pytest-lazy-fixture==0.6.3", + # https://github.com/docker/docker-py/issues/2902 + "pytest-docker==0.11.0; python_version < '3.10' or sys_platform != 'win32'", + "flaky==3.7.0", + "pytest-timeout==2.1.0", + "filelock==3.8.0", + # optional dependencies + "pywin32>=225; sys_platform == 'win32'", + "dvclive[image]>=0.7.3", + "beautifulsoup4==4.11.1", + # pylint requirements + "pylint==2.15.5", + # we use this to suppress pytest-related false positives in our tests. + "pylint-pytest==1.1.2", + # we use this to suppress some messages in tests, eg: foo/bar naming, + # and, protected method calls in our tests + "pylint-plugin-utils==0.7", + # type-checking + "mypy==0.982", + "types-requests>=2.27.15", + "types-tabulate>=0.8.6", + "types-toml>=0.10.4", +] +all = ["dvc[azure,gdrive,gs,hdfs,oss,s3,ssh,webdav,webhdfs]"] +dev = ["dvc[azure,gdrive,gs,hdfs,oss,s3,ssh,webdav,webhdfs,tests]"] + +[project.urls] +Documentation = "https://dvc.org/doc" +"Bug Tracker" = "https://github.com/iterative/dvc/issues" +Source = "https://github.com/iterative/dvc" + +[project.scripts] +dvc = "dvc.cli:main" + +[project.entry-points."fsspec.specs"] +dvc = "dvc.api:DVCFileSystem" + +[tool.setuptools] +zip-safe = false + +[tool.setuptools.packages.find] +exclude = ["dvc.testing", "dvc.testing.*", "tests", "tests.*"] + [tool.setuptools_scm] write_to = "dvc/_dvc_version.py" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index b1c62310c..000000000 --- a/setup.cfg +++ /dev/null @@ -1,166 +0,0 @@ -[metadata] -description = Git for data scientists - manage your code and data together -name = dvc -long_description = file: README.rst -long_description_content_type = text/x-rst -license = Apache License 2.0 -license_file = LICENSE -url = http://dvc.org -project_urls = - Documentation = https://dvc.org/doc - Source = https://github.com/iterative/dvc -download_url = https://github.com/iterative/dvc -author = Dmitry Petrov -author_email = dmitry@dvc.org -maintainer = Iterative -maintainer_email = support@dvc.org -keywords = data-science, data-version-control, machine-learning, git - developer-tools, reproducibility, collaboration, ai -classifiers = - Development Status :: 4 - Beta - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - -[options] -setup_requires = - setuptools>=48 - setuptools_scm[toml]>=7 - -python_requires = >=3.8 -zip_safe = False -packages = find: -include_package_data = True -install_requires = - colorama>=0.3.9 - configobj>=5.0.6 - voluptuous>=0.11.7 - requests>=2.22.0 - # See https://github.com/bdcht/grandalf/issues/26 - grandalf==0.6 - distro>=1.3.0 - appdirs>=1.4.3 - ruamel.yaml>=0.17.11 - tomlkit>=0.11.1 - funcy>=1.14 - pathspec>=0.9.0,<0.10.0 - shortuuid>=0.5.0 - tqdm>=4.63.1,<5 - packaging>=19.0 - zc.lockfile>=1.2.1 - flufl.lock>=5 - networkx>=2.5 - psutil>=5.8.0 - pydot>=1.2.4 - importlib-resources>=5.2.2; python_version < '3.9' - flatten_dict>=0.4.1,<1 - tabulate>=0.8.7 - pygtrie>=2.3.2 - dpath>=2.0.2,<3 - shtab>=1.3.4,<2 - rich>=10.13.0 - pyparsing>=2.4.7 - typing-extensions>=3.7.4 - scmrepo==0.1.2 - dvc-render==0.0.12 - dvc-task==0.1.4 - dvclive>=0.10.0 - dvc-data==0.25.2 - dvc-http==2.27.2 - hydra-core>=1.1.0 - iterative-telemetry==0.0.5 - -[options.extras_require] -all = - %(azure)s - %(gdrive)s - %(gs)s - %(hdfs)s - %(oss)s - %(s3)s - %(ssh)s - %(webdav)s - %(webhdfs)s -dev = - %(all)s - %(tests)s - dvc-data[cli] -# Extra dependencies for remote integrations -azure = dvc-azure==2.20.4 -gdrive = dvc-gdrive==2.19.0 -gs = dvc-gs==2.19.1 -hdfs = - dvc-hdfs==2.19.0; python_version < '3.11' -oss = dvc-oss==2.19.0 -s3 = dvc-s3==2.20.1 -ssh = dvc-ssh==2.20.0 -# gssapi should not be included in all_remotes, because it doesn't have wheels -# for Linux, so it will fail to compile if user doesn't have all the -# requirements, including kerberos itself. -ssh_gssapi = dvc-ssh[gssapi]==2.20.0 -webdav = dvc-webdav==2.19.0 -webhdfs = dvc-webhdfs==2.19.0 -# requests-kerberos requires krb5 & gssapi, which does not provide wheels Linux -webhdfs_kerberos = dvc-webhdfs[kerberos]==2.19.0 -terraform = tpi[ssh]>=2.1.0 -testing = - pytest-test-utils==0.0.8 -tests = - %(terraform)s - dvc-ssh==2.20.0 - # Test requirements - pytest==7.2.0 - pytest-cov==4.0.0 - pytest-xdist==3.0.2 - pytest-mock==3.10.0 - pytest-lazy-fixture==0.6.3 - %(testing)s - # https://github.com/docker/docker-py/issues/2902 - pytest-docker==0.11.0; python_version < '3.10' or sys_platform != 'win32' - flaky==3.7.0 - pytest-timeout==2.1.0 - filelock==3.8.0 - # pylint requirements - pylint==2.15.5 - # we use this to suppress pytest-related false positives in our tests. - pylint-pytest==1.1.2 - # we use this to suppress some messages in tests, eg: foo/bar naming, - # and, protected method calls in our tests - pylint-plugin-utils==0.7 - # type-checking - mypy==0.982 - types-requests>=2.27.15 - types-tabulate>=0.8.6 - types-toml>=0.10.4 - # optional dependencies - pywin32>=225; sys_platform == 'win32' - dvclive[image]>=0.7.3 - beautifulsoup4==4.11.1 - -[options.packages.find] -exclude = - dvc.testing - dvc.testing.* - tests - tests.* - -[options.entry_points] -console_scripts = - dvc = dvc.cli:main -fsspec.specs = - dvc = dvc.api:DVCFileSystem - -[flake8] -ignore= - E203, # Whitespace before ':' - E266, # Too many leading '#' for block comment - W503, # Line break occurred before a binary operator - P1, # unindexed parameters in the str.format, see: - # https://pypi.org/project/flake8-string-format/ -max_line_length = 79 -max-complexity = 15 -select = B,C,E,F,W,T4,B902,T,P -show_source = true -count = true