- Notifications
You must be signed in to change notification settings - Fork37
A support of Python v3.8#238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
dmitry-lipetsk merged 6 commits intopostgrespro:masterfromdmitry-lipetsk:D20250408_001--python_3_8Apr 10, 2025
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes from1 commit
Commits
Show all changes
6 commits Select commitHold shift + click to select a range
1618d7c A support of Python 3.8 [typing]
dmitry-lipetsk96ddf19 A support of Python 3.8 [import]
dmitry-lipetsk208c5e3 [CI] Test with python 3.8, 3.9, 3.10 and 3.11 [std2-all][alpine]
dmitry-lipetsk48c7625 Revert "A support of Python 3.8 [import]"
dmitry-lipetskb0fd127 [CI] Test with Python 3.8.0 is added [std2-all]
dmitry-lipetsk0e68acb Dockerfile--std2-all.tmpl is updated [cleanup]
dmitry-lipetskFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
[CI] Test with python 3.8, 3.9, 3.10 and 3.11 [std2-all][alpine]
We will run all the tests to get a full information about compatibility.Some new tests may fail.---TODO: may be it is better to compile/install required python version explicitly instead using pyenv.
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
commit208c5e39b5ca597ec1fba5a69e26e710a42e5aeb
There are no files selected for viewing
4 changes: 4 additions & 0 deletions.travis.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
93 changes: 93 additions & 0 deletionsDockerfile--std2-all.tmpl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| ARG PG_VERSION | ||
| ARG PYTHON_VERSION | ||
| # --------------------------------------------- base1 | ||
| FROM postgres:${PG_VERSION}-alpine as base1 | ||
| # --------------------------------------------- base2_with_python-3 | ||
| FROM base1 as base2_with_python-3 | ||
| RUN apk add --no-cache curl python3 python3-dev build-base musl-dev linux-headers py-virtualenv | ||
| # For pyenv | ||
| RUN apk add build-base gcc-doc | ||
| RUN apk add patch | ||
| RUN apk add git | ||
| RUN apk add xz-dev | ||
| RUN apk add zip | ||
| RUN apk add zlib-dev | ||
| RUN apk add libffi-dev | ||
| RUN apk add readline-dev | ||
| RUN apk add openssl openssl-dev | ||
| RUN apk add sqlite-dev | ||
| RUN apk add bzip2-dev | ||
| # --------------------------------------------- base3_with_python-3.8 | ||
| FROM base2_with_python-3 as base3_with_python-3.8 | ||
| ENV PYTHON_VERSION=3.8 | ||
| # --------------------------------------------- base3_with_python-3.9 | ||
| FROM base2_with_python-3 as base3_with_python-3.9 | ||
| ENV PYTHON_VERSION=3.9 | ||
| # --------------------------------------------- base3_with_python-3.10 | ||
| FROM base2_with_python-3 as base3_with_python-3.10 | ||
| ENV PYTHON_VERSION=3.10 | ||
| # --------------------------------------------- base3_with_python-3.11 | ||
| FROM base2_with_python-3 as base3_with_python-3.11 | ||
| ENV PYTHON_VERSION=3.11 | ||
| # --------------------------------------------- final | ||
| FROM base3_with_python-${PYTHON_VERSION} as final | ||
| #RUN apk add --no-cache mc | ||
| # Full version of "ps" command | ||
| RUN apk add --no-cache procps | ||
| RUN apk add --no-cache openssh | ||
| RUN apk add --no-cache sudo | ||
| ENV LANG=C.UTF-8 | ||
| RUN addgroup -S sudo | ||
| RUN adduser postgres sudo | ||
| EXPOSE 22 | ||
| RUN ssh-keygen -A | ||
| ADD . /pg/testgres | ||
| WORKDIR /pg/testgres | ||
| RUN chown -R postgres:postgres /pg | ||
| # It allows to use sudo without password | ||
| RUN sh -c "echo \"postgres ALL=(ALL:ALL) NOPASSWD:ALL\"">>/etc/sudoers | ||
| # THIS CMD IS NEEDED TO CONNECT THROUGH SSH WITHOUT PASSWORD | ||
| RUN sh -c "echo "postgres:*" | chpasswd -e" | ||
| USER postgres | ||
| RUN curl https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash | ||
| RUN ~/.pyenv/bin/pyenv install ${PYTHON_VERSION} | ||
| # THIS CMD IS NEEDED TO CONNECT THROUGH SSH WITHOUT PASSWORD | ||
| RUN chmod 700 ~/ | ||
| RUN mkdir -p ~/.ssh | ||
| #RUN chmod 700 ~/.ssh | ||
| ENTRYPOINT sh -c " \ | ||
| set -eux; \ | ||
| echo HELLO FROM ENTRYPOINT; \ | ||
| echo HOME DIR IS [`realpath ~/`]; \ | ||
| ssh-keygen -t rsa -f ~/.ssh/id_rsa -q -N ''; \ | ||
| cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys; \ | ||
| chmod 600 ~/.ssh/authorized_keys; \ | ||
| ls -la ~/.ssh/; \ | ||
| sudo /usr/sbin/sshd; \ | ||
| ssh-keyscan -H localhost >> ~/.ssh/known_hosts; \ | ||
| ssh-keyscan -H 127.0.0.1 >> ~/.ssh/known_hosts; \ | ||
| export PATH=\"~/.pyenv/bin:$PATH\"; \ | ||
| TEST_FILTER=\"\" bash run_tests2.sh;" |
68 changes: 68 additions & 0 deletionsrun_tests2.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| #!/usr/bin/env bash | ||
| # Copyright (c) 2017-2025 Postgres Professional | ||
| set -eux | ||
| eval "$(pyenv init -)" | ||
| eval "$(pyenv virtualenv-init -)" | ||
| pyenv virtualenv --force ${PYTHON_VERSION} cur | ||
| pyenv activate cur | ||
| if [ -z ${TEST_FILTER+x} ]; \ | ||
| then export TEST_FILTER="TestTestgresLocal or (TestTestgresCommon and (not remote))"; \ | ||
| fi | ||
| # fail early | ||
| echo check that pg_config is in PATH | ||
| command -v pg_config | ||
| # prepare python environment | ||
| VENV_PATH="/tmp/testgres_venv" | ||
| rm -rf $VENV_PATH | ||
| python -m venv "${VENV_PATH}" | ||
| export VIRTUAL_ENV_DISABLE_PROMPT=1 | ||
| source "${VENV_PATH}/bin/activate" | ||
| pip install coverage flake8 psutil Sphinx pytest pytest-xdist psycopg2 six psutil | ||
| # install testgres' dependencies | ||
| export PYTHONPATH=$(pwd) | ||
| # $PIP install . | ||
| # test code quality | ||
| flake8 . | ||
| # remove existing coverage file | ||
| export COVERAGE_FILE=.coverage | ||
| rm -f $COVERAGE_FILE | ||
| # run tests (PATH) | ||
| time coverage run -a -m pytest -l -v -n 4 -k "${TEST_FILTER}" | ||
| # run tests (PG_BIN) | ||
| PG_BIN=$(pg_config --bindir) \ | ||
| time coverage run -a -m pytest -l -v -n 4 -k "${TEST_FILTER}" | ||
| # run tests (PG_CONFIG) | ||
| PG_CONFIG=$(pg_config --bindir)/pg_config \ | ||
| time coverage run -a -m pytest -l -v -n 4 -k "${TEST_FILTER}" | ||
| # show coverage | ||
| coverage report | ||
| # build documentation | ||
| cd docs | ||
| make html | ||
| cd .. | ||
| # attempt to fix codecov | ||
| set +eux | ||
| # send coverage stats to Codecov | ||
| bash <(curl -s https://codecov.io/bash) |
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.