Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
python-poetry
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
python-poetry
Commits
c32395b4
Commit
c32395b4
authored
Jul 18, 2022
by
finswimmer
Committed by
Bjorn Neergaard
Jul 18, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs(faq): show tox config for different use cases
parent
fc0597c7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
6 deletions
+44
-6
docs/faq.md
+44
-6
No files found.
docs/faq.md
View file @
c32395b4
...
@@ -57,20 +57,58 @@ requires = ["poetry-core>=1.0.0"]
...
@@ -57,20 +57,58 @@ requires = ["poetry-core>=1.0.0"]
build-backend
=
"poetry.core.masonry.api"
build-backend
=
"poetry.core.masonry.api"
```
```
And use a
`tox.ini`
configuration file similar to this:
`tox`
can be configured in multiple ways. It depends on what should be the code under test and which dependencies
should be installed.
```
INI
#### Usecase #1
```
ini
[tox]
[tox]
isolated_build
=
true
isolated_build
=
true
envlist = py27, py37
[testenv]
[testenv]
allowlist_externals = poetry
deps
=
pytest
commands
=
commands
=
poetry install -v
pytest
tests/
--import-mode
importlib
poetry run pytest tests/
```
```
`tox`
will create an
`sdist`
package of the project and uses
`pip`
to install it in a fresh environment.
Thus, dependencies are resolved by
`pip`
.
#### Usecase #2
```
ini
[tox]
isolated_build
=
true
[testenv]
whitelist_externals
=
poetry
commands_pre
=
poetry
install
--no-root
--sync
commands
=
poetry
run
pytest
tests/
--import-mode
importlib
```
`tox`
will create an
`sdist`
package of the project and uses
`pip`
to install it in a fresh environment.
Thus, dependencies are resolved by
`pip`
in the first place. But afterwards we run Poetry,
which will install the locked dependencies into the environment.
#### Usecase #3
```
ini
[tox]
isolated_build
=
true
[testenv]
skip_install
=
true
whitelist_externals
=
poetry
commands_pre
=
poetry
install
commands
=
poetry
run
pytest
tests/
--import-mode
importlib
```
`tox`
will not do any install. Poetry installs all the dependencies and the current package an editable mode.
Thus, tests are running against the local files and not the builded and installed package.
### I don't want Poetry to manage my virtual environments. Can I disable it?
### I don't want Poetry to manage my virtual environments. Can I disable it?
While Poetry automatically creates virtual environments to always work isolated
While Poetry automatically creates virtual environments to always work isolated
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment