【发布时间】:2021-01-19 00:53:52
【问题描述】:
问题
当我从 GitHub 安装 pacakge 时,如何使用 tox 安装本地包而不参考随机时间?
上下文
在this PR 中,我正在尝试构建和测试我的包dbt-synapse,然后将新的次要版本发布到PyPI。在某些时候(新手移动),我想我尝试使用以下行直接从特定的 GitHub 提交安装包。
pip install -e git+https://github.com/dbt-msft/dbt-synapse.git@345d7cafcb08bac25d23867a2e22c0e9b741f603#egg=dbt_synapse
Here's a gist of the requirements.txt, tox.ini, setup.py and some other files
当我调用 tox -e integration-synapse 开始测试时,将 deps 中的实际软件包列为 -e. 而只是 .,导致从 GitHub 安装软件包(请参阅下面的 integration-synapse installed: 行, 为清楚起见缩短)!
当 deps 只有 .,但它会将其列为已安装(这似乎也不正确):dbt-synapse @ file:///Users/anders.swanson/repos/dbt-synapse。
不幸的是,两者都没有告诉我我知道应该发生的事情。
integration-synapse recreate: /Users/anders.swanson/repos/dbt-synapse/.tox/integration-synapse
integration-synapse installdeps: -rrequirements.txt, -e.
integration-synapse installed: [...],-e git+https://github.com/dbt-msft/dbt-synapse.git@345d7cafcb08bac25d23867a2e22c0e9b741f603#egg=dbt_synapse,[...]
integration-synapse runtests: PYTHONHASHSEED='1932234374'
integration-synapse runtests: commands[0] | /bin/bash -c '/Users/anders.swanson/repos/dbt-synapse/.tox/integration-synapse/bin/python -m pytest -v test/integration/synapse.dbtspec'
======================================================================================================================================== test session starts =========================================================================================================================================
platform darwin -- Python 3.6.12, pytest-6.2.1, py-1.10.0, pluggy-0.13.1 -- /Users/anders.swanson/repos/dbt-synapse/.tox/integration-synapse/bin/python
cachedir: .pytest_cache
rootdir: /Users/anders.swanson/repos/dbt-synapse
plugins: dbt-adapter-0.4.0
collected 1 item
tox.ini
[tox]
skipsdist = True
envlist = integration-synapse
[testenv:integration-synapse]
basepython = python3
commands = /bin/bash -c '{envpython} -m pytest -v test/integration/synapse.dbtspec'
passenv = DBT_SYNAPSE_DB DBT_SYNAPSE_PORT DBT_SYNAPSE_PWD DBT_SYNAPSE_SERVER DBT_SYNAPSE_UID
deps =
-rrequirements.txt
-e.
【问题讨论】:
标签: python pip pytest conda tox