Пример #1
0
def test_convert_poetry(project):
    golden_file = FIXTURES / "pyproject-poetry.toml"
    assert poetry.check_fingerprint(project, golden_file)
    result = poetry.convert(project, golden_file)

    assert result["author"] == "Sébastien Eustace <*****@*****.**>"
    assert result["name"] == "poetry"
    assert result["version"] == "1.0.0"
    assert "Repository" in result["project_urls"]
    assert result["python_requires"] == ">=2.7,<4.0,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*"
    assert result["dependencies"]["cleo"]["marker"] == "python_version ~= '2.7'"
    assert result["dependencies"]["cachecontrol"]["marker"] == (
        "python_version >= '3.4' and python_version < '4.0'"
    )
    assert "psycopg2" not in result["dependencies"]
    assert "psycopg2" in result["pgsql-dependencies"]
    assert sorted(result["extras"]) == ["mysql", "pgsql"]
    assert len(result["dev-dependencies"]) == 2

    assert result["cli"] == {"poetry": "poetry.console:run"}
    assert result["entry_points"]["blogtool.parsers"] == {
        ".rst": "some_module:SomeClass"
    }
    assert result["includes"] == ["lib/my_package", "tests", "CHANGELOG.md"]
    assert result["excludes"] == ["my_package/excluded.py"]
Пример #2
0
def test_convert_poetry(project):
    golden_file = FIXTURES / "pyproject-poetry.toml"
    assert poetry.check_fingerprint(project, golden_file)
    with cd(FIXTURES):
        result, settings = poetry.convert(
            project, golden_file, Namespace(dev=False, group=None)
        )

    assert result["authors"][0] == {
        "name": "Sébastien Eustace",
        "email": "*****@*****.**",
    }
    assert result["name"] == "poetry"
    assert result["version"] == "1.0.0"
    assert result["license-expression"] == "MIT"
    assert "repository" in result["urls"]
    assert result["requires-python"] == ">=2.7,<4.0,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*"
    assert 'cleo<1.0.0,>=0.7.6; python_version ~= "2.7"' in result["dependencies"]
    assert (
        'cachecontrol[filecache]<1.0.0,>=0.12.4; python_version >= "3.4" '
        'and python_version < "4.0"' in result["dependencies"]
    )
    assert "babel==2.9.0" in result["dependencies"]
    assert "mysql" in result["optional-dependencies"]
    assert "psycopg2<3.0,>=2.7" in result["optional-dependencies"]["pgsql"]
    assert len(settings["dev-dependencies"]["dev"]) == 2

    assert result["scripts"] == {"poetry": "poetry.console:run"}
    assert result["entry-points"]["blogtool.parsers"] == {
        ".rst": "some_module:SomeClass"
    }
    assert settings["includes"] == ["lib/my_package", "tests", "CHANGELOG.md"]
    assert settings["excludes"] == ["my_package/excluded.py"]