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
8f8e190d
Commit
8f8e190d
authored
Oct 13, 2021
by
Jason Racine
Committed by
Arun Babu Neelicattu
Oct 30, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove some instances of branching code supporting older python versions
parent
3bbec0c6
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
9 additions
and
35 deletions
+9
-35
docs/managing-environments.md
+3
-3
poetry/repositories/installed_repository.py
+1
-5
sonnet
+0
-2
tests/installation/test_installer.py
+1
-6
tests/installation/test_installer_old.py
+1
-6
tests/utils/fixtures/setups/pyyaml/setup.py
+2
-5
tests/utils/fixtures/setups/sqlalchemy/setup.py
+0
-2
tests/utils/test_env.py
+1
-6
No files found.
docs/managing-environments.md
View file @
8f8e190d
...
@@ -30,12 +30,12 @@ to activate one explicitly, see [Switching environments](#switching-between-envi
...
@@ -30,12 +30,12 @@ to activate one explicitly, see [Switching environments](#switching-between-envi
To easily switch between Python versions, it is recommended to
To easily switch between Python versions, it is recommended to
use
[
pyenv
](
https://github.com/pyenv/pyenv
)
or similar tools.
use
[
pyenv
](
https://github.com/pyenv/pyenv
)
or similar tools.
For instance, if your project is Python
2.7
only, a standard workflow
For instance, if your project is Python
3.6
only, a standard workflow
would be:
would be:
```
bash
```
bash
pyenv install
2.7
.15
pyenv install
3.6
.15
pyenv
local
2.7.15
# Activate Python 2.7
for the current project
pyenv
local
3.6.15
# Activate Python 3.6
for the current project
poetry install
poetry install
```
```
{{% /note %}}
{{% /note %}}
...
...
poetry/repositories/installed_repository.py
View file @
8f8e190d
...
@@ -63,11 +63,7 @@ class InstalledRepository(Repository):
...
@@ -63,11 +63,7 @@ class InstalledRepository(Repository):
if
line
and
not
line
.
startswith
((
"#"
,
"import "
,
"import
\t
"
)):
if
line
and
not
line
.
startswith
((
"#"
,
"import "
,
"import
\t
"
)):
path
=
Path
(
line
)
path
=
Path
(
line
)
if
not
path
.
is_absolute
():
if
not
path
.
is_absolute
():
try
:
path
=
lib
.
joinpath
(
path
)
.
resolve
()
path
=
lib
.
joinpath
(
path
)
.
resolve
()
except
FileNotFoundError
:
# this is required to handle pathlib oddity on win32 python==3.5
path
=
lib
.
joinpath
(
path
)
paths
.
add
(
path
)
paths
.
add
(
path
)
src_path
=
env
.
path
/
"src"
/
name
src_path
=
env
.
path
/
"src"
/
name
...
...
sonnet
View file @
8f8e190d
...
@@ -230,8 +230,6 @@ class MakeReleaseCommand(Command):
...
@@ -230,8 +230,6 @@ class MakeReleaseCommand(Command):
subprocess
.
check_output
(
subprocess
.
check_output
(
[
python
,
"-V"
],
stderr
=
subprocess
.
STDOUT
,
shell
=
WINDOWS
[
python
,
"-V"
],
stderr
=
subprocess
.
STDOUT
,
shell
=
WINDOWS
)
)
if
version
==
"3.4"
and
WINDOWS
:
continue
subprocess
.
check_output
([
python
,
"-m"
,
"pip"
,
"install"
,
"pip"
,
"-U"
])
subprocess
.
check_output
([
python
,
"-m"
,
"pip"
,
"install"
,
"pip"
,
"-U"
])
except
subprocess
.
CalledProcessError
:
except
subprocess
.
CalledProcessError
:
...
...
tests/installation/test_installer.py
View file @
8f8e190d
...
@@ -2,7 +2,6 @@ from __future__ import unicode_literals
...
@@ -2,7 +2,6 @@ from __future__ import unicode_literals
import
itertools
import
itertools
import
json
import
json
import
sys
from
pathlib
import
Path
from
pathlib
import
Path
...
@@ -1751,11 +1750,7 @@ def test_installer_test_solver_finds_compatible_package_for_dependency_python_no
...
@@ -1751,11 +1750,7 @@ def test_installer_test_solver_finds_compatible_package_for_dependency_python_no
expected
=
fixture
(
"with-conditional-dependency"
)
expected
=
fixture
(
"with-conditional-dependency"
)
assert
locker
.
written_data
==
expected
assert
locker
.
written_data
==
expected
assert
1
==
installer
.
executor
.
installations_count
if
sys
.
version_info
>=
(
3
,
5
,
0
):
assert
1
==
installer
.
executor
.
installations_count
else
:
assert
0
==
installer
.
executor
.
installations_count
def
test_installer_required_extras_should_not_be_removed_when_updating_single_dependency
(
def
test_installer_required_extras_should_not_be_removed_when_updating_single_dependency
(
...
...
tests/installation/test_installer_old.py
View file @
8f8e190d
from
__future__
import
unicode_literals
from
__future__
import
unicode_literals
import
itertools
import
itertools
import
sys
from
pathlib
import
Path
from
pathlib
import
Path
...
@@ -1447,11 +1446,7 @@ def test_installer_test_solver_finds_compatible_package_for_dependency_python_no
...
@@ -1447,11 +1446,7 @@ def test_installer_test_solver_finds_compatible_package_for_dependency_python_no
assert
locker
.
written_data
==
expected
assert
locker
.
written_data
==
expected
installs
=
installer
.
installer
.
installs
installs
=
installer
.
installer
.
installs
assert
len
(
installs
)
==
1
if
sys
.
version_info
>=
(
3
,
5
,
0
):
assert
len
(
installs
)
==
1
else
:
assert
len
(
installs
)
==
0
def
test_installer_required_extras_should_not_be_removed_when_updating_single_dependency
(
def
test_installer_required_extras_should_not_be_removed_when_updating_single_dependency
(
...
...
tests/utils/fixtures/setups/pyyaml/setup.py
View file @
8f8e190d
...
@@ -308,10 +308,7 @@ class test(Command):
...
@@ -308,10 +308,7 @@ class test(Command):
build_cmd
=
self
.
get_finalized_command
(
"build"
)
build_cmd
=
self
.
get_finalized_command
(
"build"
)
build_cmd
.
run
()
build_cmd
.
run
()
sys
.
path
.
insert
(
0
,
build_cmd
.
build_lib
)
sys
.
path
.
insert
(
0
,
build_cmd
.
build_lib
)
if
sys
.
version_info
[
0
]
<
3
:
sys
.
path
.
insert
(
0
,
"tests/lib3"
)
sys
.
path
.
insert
(
0
,
"tests/lib"
)
else
:
sys
.
path
.
insert
(
0
,
"tests/lib3"
)
import
test_all
import
test_all
if
not
test_all
.
main
([]):
if
not
test_all
.
main
([]):
...
@@ -337,7 +334,7 @@ if __name__ == "__main__":
...
@@ -337,7 +334,7 @@ if __name__ == "__main__":
url
=
URL
,
url
=
URL
,
download_url
=
DOWNLOAD_URL
,
download_url
=
DOWNLOAD_URL
,
classifiers
=
CLASSIFIERS
,
classifiers
=
CLASSIFIERS
,
package_dir
=
{
""
:
{
2
:
"lib"
,
3
:
"lib3"
}[
sys
.
version_info
[
0
]]
},
package_dir
=
{
""
:
"lib3"
},
packages
=
[
"yaml"
],
packages
=
[
"yaml"
],
ext_modules
=
[
ext_modules
=
[
Extension
(
Extension
(
...
...
tests/utils/fixtures/setups/sqlalchemy/setup.py
View file @
8f8e190d
...
@@ -12,8 +12,6 @@ from setuptools import find_packages
...
@@ -12,8 +12,6 @@ from setuptools import find_packages
from
setuptools.command.test
import
test
as
TestCommand
from
setuptools.command.test
import
test
as
TestCommand
cmdclass
=
{}
cmdclass
=
{}
if
sys
.
version_info
<
(
2
,
7
):
raise
Exception
(
"SQLAlchemy requires Python 2.7 or higher."
)
cpython
=
platform
.
python_implementation
()
==
"CPython"
cpython
=
platform
.
python_implementation
()
==
"CPython"
...
...
tests/utils/test_env.py
View file @
8f8e190d
...
@@ -963,12 +963,7 @@ def test_env_system_packages(tmp_path, config):
...
@@ -963,12 +963,7 @@ def test_env_system_packages(tmp_path, config):
EnvManager
(
config
)
.
build_venv
(
path
=
venv_path
,
flags
=
{
"system-site-packages"
:
True
})
EnvManager
(
config
)
.
build_venv
(
path
=
venv_path
,
flags
=
{
"system-site-packages"
:
True
})
if
sys
.
version_info
>=
(
3
,
3
):
assert
"include-system-site-packages = true"
in
pyvenv_cfg
.
read_text
()
assert
"include-system-site-packages = true"
in
pyvenv_cfg
.
read_text
()
elif
(
2
,
6
)
<
sys
.
version_info
<
(
3
,
0
):
assert
not
venv_path
.
joinpath
(
"lib"
,
"python2.7"
,
"no-global-site-packages.txt"
)
.
exists
()
def
test_env_finds_the_correct_executables
(
tmp_dir
,
manager
):
def
test_env_finds_the_correct_executables
(
tmp_dir
,
manager
):
...
...
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