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
e859c44f
Unverified
Commit
e859c44f
authored
Sep 21, 2020
by
Sébastien Eustace
Committed by
GitHub
Sep 21, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2941 from abn/fix/sonnet
Fix inconsistencies with release scripts
parents
6d560e34
95523da4
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
44 deletions
+48
-44
.cirrus.yml
+23
-4
.github/workflows/main.yml
+8
-11
make-nix-release.sh
+1
-1
poetry/installation/executor.py
+3
-1
sonnet
+13
-27
No files found.
.cirrus.yml
View file @
e859c44f
...
...
@@ -28,25 +28,44 @@ release_task:
name
:
"
Release
/
FreeBSD"
only_if
:
$CIRRUS_TAG != ''
env
:
GITHUB_TOKEN
:
ENCRYPTED[e637a1887c028ea4e44867715a8a4b7c5e27568559a15c45a3e33739b0d97fc050394c728a44e9bfe7c246179810cad7]
GITHUB_TOKEN
:
ENCRYPTED[2b573a2d28a03523ac6fb5b3c2f513a41c0a98db81e40e50e1d103b171f85c57e58ae38d957499dbf7fd7635cfcfd7be]
PYTHON
:
python3.8
PYTHON27
:
python2.7
PYTHON35
:
python3.5
PYTHON36
:
python3.6
PYTHON37
:
python3.7
PYTHON38
:
python3.8
freebsd_instance
:
matrix
:
-
image_family
:
freebsd-12-1-snap
-
image_family
:
freebsd-11-3-snap
python_script
:
pkg install -y curl python3 python27 python35 python36 python37 python38
python_script
:
pkg install -y curl
bash
python3 python27 python35 python36 python37 python38
pip_script
:
-
python2.7 -m ensurepip
-
python3.5 -m ensurepip
-
python3.6 -m ensurepip
-
python3.7 -m ensurepip
-
python3.8 -m ensurepip
build_script
:
./make-nix-release.sh
build_script
:
bash
./make-nix-release.sh
upload_script
:
|
#!/usr/bin/env bash
if [[ "$CIRRUS_RELEASE" == "" ]]; then
echo "Not a release. No need to deploy!"
exit 0
fi
if [[ "$GITHUB_TOKEN" == "" ]]; then
echo "Please provide GitHub access token via GITHUB_TOKEN environment variable!"
exit 1
fi
for fpath in releases/*
do
echo "Uploading $fpath..."
name=$(basename "$fpath")
url_to_upload="https://uploads.github.com/repos/$CIRRUS_REPO_FULL_NAME/releases/$CIRRUS_TAG/assets?name=$name"
url_to_upload="https://uploads.github.com/repos/$CIRRUS_REPO_FULL_NAME/releases/$CIRRUS_RELEASE/assets?name=$name"
echo "Uploading to $url_to_upload"
curl -X POST \
--data-binary @$fpath \
--header "Authorization: token $GITHUB_TOKEN" \
...
...
.github/workflows/main.yml
View file @
e859c44f
...
...
@@ -36,15 +36,16 @@ jobs:
shell
:
bash
run
:
echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
-
name
:
Install
poetry
-
name
:
Bootstrap
poetry
shell
:
bash
run
:
|
python get-poetry.py -y --preview
echo "::set-env name=PATH::$HOME/.poetry/bin:$PATH"
python -m ensurepip
python -m pip install --upgrade pip
python -m pip install .
-
name
:
Configure poetry
shell
:
bash
run
:
poetry config virtualenvs.in-project
true
run
:
p
ython -m p
oetry config virtualenvs.in-project
true
-
name
:
Set up cache
uses
:
actions/cache@v2
...
...
@@ -56,16 +57,12 @@ jobs:
-
name
:
Ensure cache is healthy
if
:
steps.cache.outputs.cache-hit == 'true'
shell
:
bash
run
:
poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
-
name
:
Upgrade pip
shell
:
bash
run
:
poetry run python -m pip install pip -U
run
:
python -m poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
-
name
:
Install dependencies
shell
:
bash
run
:
poetry install
run
:
p
ython -m p
oetry install
-
name
:
Run pytest
shell
:
bash
run
:
poetry run python -m pytest -v tests
run
:
p
ython -m p
oetry run python -m pytest -v tests
make-nix-release.sh
View file @
e859c44f
...
...
@@ -19,6 +19,6 @@ else
POETRY
=
"
$PYTHON
-m poetry"
fi
$POETRY
config virtualenvs.
create
fals
e
$POETRY
config virtualenvs.
in-project
tru
e
$POETRY
install
--no-dev
$POETRY
run python sonnet make release
${
RUNTIMES
[@]
}
poetry/installation/executor.py
View file @
e859c44f
...
...
@@ -12,6 +12,8 @@ from subprocess import CalledProcessError
from
poetry.core.packages.file_dependency
import
FileDependency
from
poetry.core.packages.utils.link
import
Link
from
poetry.io.null_io
import
NullIO
from
poetry.utils._compat
import
PY2
from
poetry.utils._compat
import
WINDOWS
from
poetry.utils._compat
import
OrderedDict
from
poetry.utils._compat
import
Path
from
poetry.utils._compat
import
cpu_count
...
...
@@ -39,7 +41,7 @@ class Executor(object):
self
.
_chef
=
Chef
(
config
,
self
.
_env
)
self
.
_chooser
=
Chooser
(
pool
,
self
.
_env
)
if
parallel
:
if
parallel
and
not
(
PY2
and
WINDOWS
)
:
# This should be directly handled by ThreadPoolExecutor
# however, on some systems the number of CPUs cannot be determined
# (it raises a NotImplementedError), so, in this case, we assume
...
...
sonnet
View file @
e859c44f
...
...
@@ -55,10 +55,7 @@ class MakeReleaseCommand(Command):
from
poetry
.
repositories
.
pool
import
Pool
from
poetry
.
repositories
.
repository
import
Repository
from
poetry
.
utils
.
_compat
import
Path
from
poetry
.
utils
.
_compat
import
decode
from
poetry
.
utils
.
_compat
import
encode
from
poetry
.
utils
.
_compat
import
subprocess
from
poetry
.
utils
.
env
import
GET_BASE_PREFIX
from
poetry
.
utils
.
env
import
EnvManager
from
poetry
.
utils
.
env
import
VirtualEnv
from
poetry
.
utils
.
helpers
import
temporary_directory
...
...
@@ -100,17 +97,12 @@ class MakeReleaseCommand(Command):
version
)
)
prefix
=
decode
(
subprocess
.
run
(
[
python
],
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
,
input
=
encode
(
GET_BASE_PREFIX
),
check
=
True
,
shell
=
WINDOWS
,
).
stdout
)
env
=
VirtualEnv
(
Path
(
prefix
.
strip
()),
base
=
Path
(
prefix
.
strip
()))
with
temporary_directory
()
as
tmp_venv_dir
:
venv_dir
=
Path
(
tmp_venv_dir
)
/
".venv"
EnvManager
.
build_venv
(
venv_dir
.
as_posix
(),
executable
=
python
)
env
=
VirtualEnv
(
venv_dir
,
venv_dir
)
solver
=
Solver
(
package
,
pool
,
Repository
(),
Repository
(),
self
.
io
)
with
solver
.
use_environment
(
env
):
ops
=
solver
.
solve
()
...
...
@@ -118,14 +110,13 @@ class MakeReleaseCommand(Command):
if
not
env
.
is_valid_for_marker
(
op
.
package
.
marker
):
op
.
skip
(
"Not needed for the current environment"
)
vendor_dir
=
Path
(
self
.
vendorize_for_python
(
python
,
env
,
[
op
.
package
for
op
in
ops
if
not
op
.
skipped
],
poetry_dir
,
version
,
)
vendor_dir
=
Path
(
os
.
path
.
join
(
poetry_dir
,
"_vendor"
,
"py{}"
.
format
(
python
))
)
created_files
+=
[
p
.
relative_to
(
Path
(
tmp_dir
))
...
...
@@ -227,7 +218,7 @@ class MakeReleaseCommand(Command):
except
subprocess
.
CalledProcessError
:
raise
RuntimeError
(
"Python {} is not available"
.
format
(
version
))
def
vendorize_for_python
(
self
,
python
,
packages
,
dest
,
python_version
):
def
vendorize_for_python
(
self
,
env
,
packages
,
dest
,
python_version
):
vendor_dir
=
os
.
path
.
join
(
dest
,
"_vendor"
,
"py{}"
.
format
(
python_version
))
bar
=
self
.
progress_bar
(
max
=
len
(
packages
))
...
...
@@ -239,19 +230,12 @@ class MakeReleaseCommand(Command):
)
bar
.
start
()
for
package
in
packages
:
subprocess
.
check_output
(
[
python
,
"-m"
,
"pip"
,
env
.
run_pip
(
"install"
,
"{}=={}"
.
format
(
package
.
name
,
package
.
version
),
"--no-deps"
,
"--target"
,
vendor_dir
,
],
stderr
=
subprocess
.
STDOUT
,
shell
=
WINDOWS
,
)
bar
.
advance
()
...
...
@@ -259,6 +243,8 @@ class MakeReleaseCommand(Command):
self
.
line
(
""
)
return
vendor_dir
class
MakeCommand
(
Command
):
"""
...
...
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