How to use the flit.upload.get_repository function in flit

To help you get started, we’ve selected a few flit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github takluyver / flit / tests / test_upload.py View on Github external
def test_get_repository_env():
    with modified_env({
        'FLIT_INDEX_URL': 'https://pypi.example.com',
        'FLIT_USERNAME': 'alice',
        'FLIT_PASSWORD': 'p4ssword',  # Also not a real password
    }):
        repo = upload.get_repository(cfg_file=io.StringIO(pypirc1))
        # Because we haven't specified a repo name, environment variables should
        # have higher priority than the config file.
        assert repo['url'] == 'https://pypi.example.com'
        assert repo['username'] == 'alice'
        assert repo['password'] == 'p4ssword'
github takluyver / flit / tests / test_upload.py View on Github external
def test_get_repository():
    repo = upload.get_repository(cfg_file=io.StringIO(pypirc1))
    assert repo['url'] == upload.PYPI
    assert repo['username'] == 'fred'
    assert repo['password'] == 's3cret'
github takluyver / flit / tests / test_upload.py View on Github external
def test_get_repository_keyring():
    with modified_env({'FLIT_PASSWORD': None}), \
            _fake_keyring('tops3cret'):
        repo = upload.get_repository(cfg_file=io.StringIO(pypirc2))

    assert repo['username'] == 'fred'
    assert repo['password'] == 'tops3cret'