diff --git a/pyproject.toml b/pyproject.toml index 39a5caae..66780880 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,19 @@ classifiers = [ ] requires-python = ">=3.8" dynamic = ["version"] -dependencies = [] +dependencies = [ + "gitpython>3", + "dulwich>=0.21.6", + "pygit2>=1.13.3", + "pygtrie>=2.3.2", + "fsspec>=2021.7.0", + "pathspec>=0.9.0", + "asyncssh>=2.13.1,<3", + "funcy>=1.14", + "shortuuid>=0.5.0", + "dvc-objects>=1.0.1,<2", + "dvc-http>=2.29.0", +] [project.urls] Issues = "https://github.com/iterative/scmrepo/issues" @@ -33,11 +45,23 @@ tests = [ "pytest-cov==3.0.0", "pytest-mock==3.8.2", "mypy==0.971", + "pytest-test-utils==0.0.8", + "pytest-asyncio==0.18.3", + # https://github.com/docker/docker-py/issues/2902 + "pytest-docker==0.12.0; python_version < '3.10' and implementation_name != 'pypy'", + "mock==5.1.0", + "paramiko==3.3.1", + "types-certifi==2021.10.8.3", + "types-mock==5.1.0.2", + "types-paramiko==3.3.0.0", ] dev = [ "scmrepo[tests]", ] +[tool.setuptools.package-data] +dvc_objects = ["py.typed"] + [tool.setuptools.packages.find] where = ["src"] namespaces = false diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 44505d01..00000000 --- a/setup.cfg +++ /dev/null @@ -1,83 +0,0 @@ -[metadata] -description = SCM wrapper and fsspec filesystem for Git for use in DVC -name = scmrepo -long_description = file: README.rst -long_description_content_type = text/x-rst -license = Apache-2.0 -license_file = LICENSE -url = https://github.com/iterative/scmrepo -platforms=any -authors = Iterative -maintainer_email = support@dvc.org -classifiers = - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - Development Status :: 4 - Beta - -[options] -python_requires = >=3.8 -zip_safe = False -package_dir= - =src -packages = find: -install_requires= - gitpython>3 - dulwich>=0.21.6 - pygit2>=1.13.3 - pygtrie>=2.3.2 - fsspec>=2021.7.0 - pathspec>=0.9.0 - asyncssh>=2.13.1,<3 - funcy>=1.14 - shortuuid>=0.5.0 - dvc-objects>=1.0.1,<2 - dvc-http>=2.29.0 - -[options.extras_require] -tests = - pytest==7.2.0 - pytest-sugar==0.9.5 - pytest-cov==3.0.0 - pytest-mock==3.8.2 - pylint==2.15.0 - mypy==0.971 - pytest-test-utils==0.0.8 - pytest-asyncio==0.18.3 - # https://github.com/docker/docker-py/issues/2902 - pytest-docker==0.12.0; python_version < '3.10' and implementation_name != 'pypy' - mock==5.1.0 - paramiko==3.3.1 - types-certifi==2021.10.8.3 - types-mock==5.1.0.2 - types-paramiko==3.3.0.0 -dev = - %(tests)s - -[options.packages.find] -exclude = - tests - tests.* -where=src - -[options.package_data] -scmrepo = py.typed - -[flake8] -ignore= - # Whitespace before ':' - E203 - # Too many leading '#' for block comment - E266 - # Line break occurred before a binary operator - W503 - # unindexed parameters in the str.format, see: - # https://pypi.org/project/flake8-string-format/ - P1 -max_line_length = 88 -max-complexity = 15 -select = B,C,E,F,W,T4,B902,T,P -show_source = true -count = true diff --git a/src/scmrepo/git/credentials.py b/src/scmrepo/git/credentials.py index 0f696608..1ac86964 100644 --- a/src/scmrepo/git/credentials.py +++ b/src/scmrepo/git/credentials.py @@ -292,7 +292,8 @@ def _input_tty(prompt: str = "Username: ") -> str: with ExitStack() as stack: try: fd = os.open( - "/dev/tty", os.O_RDWR | os.O_NOCTTY # pylint: disable=no-member + "/dev/tty", + os.O_RDWR | os.O_NOCTTY, # pylint: disable=no-member ) tty = io.FileIO(fd, "w+") stack.enter_context(tty) diff --git a/tests/test_credentials.py b/tests/test_credentials.py index a73f7b0a..9acc1f72 100644 --- a/tests/test_credentials.py +++ b/tests/test_credentials.py @@ -174,13 +174,11 @@ def test_get_matching_commands(): from dulwich.config import ConfigFile config_file = io.BytesIO( - """ + b""" [credential] helper = /usr/local/bin/my-helper UseHttpPath = true -""".encode( - "ascii" - ) +""" ) config_file.seek(0) config = ConfigFile.from_file(config_file) @@ -189,12 +187,10 @@ def test_get_matching_commands(): ) == [("/usr/local/bin/my-helper", True)] config_file = io.BytesIO( - """ + b""" [credential] helper = /usr/local/bin/my-helper -""".encode( - "ascii" - ) +""" ) config_file.seek(0) config = ConfigFile.from_file(config_file) @@ -203,12 +199,10 @@ def test_get_matching_commands(): ) == [("/usr/local/bin/my-helper", False)] config_file = io.BytesIO( - """ + b""" [credential] helper = -""".encode( - "ascii" - ) +""" ) config_file.seek(0) config = ConfigFile.from_file(config_file)