Commit 2a91e9f4 authored by Godefroid Chapelle's avatar Godefroid Chapelle

Fix github actions

parent 346333a9
FROM centos as centos-python FROM quay.io/centos/centos:stream8 as centos-python
RUN yum install -y make gcc openssl-devel libffi-devel sqlite-devel glibc-langpack-en RUN yum install -y make gcc openssl-devel libffi-devel sqlite-devel glibc-langpack-en
RUN useradd -ms /bin/bash buildout RUN useradd -ms /bin/bash buildout
USER buildout USER buildout
...@@ -19,3 +19,4 @@ USER root ...@@ -19,3 +19,4 @@ USER root
RUN chown -R buildout:buildout * RUN chown -R buildout:buildout *
USER buildout USER buildout
RUN make PYTHON_VER=${PYTHON_VER} build RUN make PYTHON_VER=${PYTHON_VER} build
COPY Makefile.builds /home/buildout/sandbox/
...@@ -20,3 +20,4 @@ USER root ...@@ -20,3 +20,4 @@ USER root
RUN chown -R buildout:buildout * RUN chown -R buildout:buildout *
USER buildout USER buildout
RUN make PYTHON_VER=${PYTHON_VER} build RUN make PYTHON_VER=${PYTHON_VER} build
COPY Makefile.builds /home/buildout/sandbox/
FROM debian:stable-slim as debian-python FROM debian:stable-slim as debian-python
RUN apt-get update RUN apt-get update
RUN apt-get install -y gcc python3-dev python3-certifi python3-setuptools python3-coverage python3-wheel RUN apt-get install -y gcc python3-dev python3-certifi python3-setuptools python3-coverage python3-wheel make
RUN useradd -ms /bin/bash buildout RUN useradd -ms /bin/bash buildout
USER buildout USER buildout
RUN mkdir /home/buildout/sandbox RUN mkdir /home/buildout/sandbox
...@@ -15,3 +15,4 @@ USER root ...@@ -15,3 +15,4 @@ USER root
RUN chown -R buildout:buildout * RUN chown -R buildout:buildout *
USER buildout USER buildout
RUN python3 dev.py RUN python3 dev.py
COPY Makefile Makefile.* /home/buildout/sandbox/
sandbox/bin/python:
pip install virtualenv
virtualenv --no-setuptools sandbox
sandbox/bin/pip install -e "git+https://github.com/pypa/setuptools.git#egg=setuptools"
sandbox/bin/buildout: sandbox/bin/python
sandbox/bin/python setup.py develop
...@@ -27,14 +27,12 @@ jobs: ...@@ -27,14 +27,12 @@ jobs:
with: with:
path: eggs path: eggs
key: ${{ matrix.os }}-{{ matrix.python-version }}-eggs key: ${{ matrix.os }}-{{ matrix.python-version }}-eggs
- name: Install dev environment
run: |
python dev.py
- name: Run tests - name: Run tests
env: env:
TMPDIR: ${{ env.HOME }}/AppData/Local/Temp TMPDIR: ${{ env.HOME }}/AppData/Local/Temp
TMP: ${{ env.HOME }}/AppData/Local/Temp TMP: ${{ env.HOME }}/AppData/Local/Temp
TEMP: ${{ env.HOME }}/AppData/Local/Temp TEMP: ${{ env.HOME }}/AppData/Local/Temp
BUILD_TYPE: bare_machines
run: | run: |
echo $TMPDIR echo $TMPDIR
bin/test -c -vvv ./ci_build.sh
...@@ -22,18 +22,12 @@ jobs: ...@@ -22,18 +22,12 @@ jobs:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- name: Setup buildout virtualenv - name: Setup buildout virtualenv
run: | run: |
make -f .github/workflows/Makefile sandbox/bin/buildout make -f .github/workflows/Makefile-scripts-setuptools-head sandbox/bin/buildout
- name: Use setuptools develop
env:
PYTHON_VERSION: ${{matrix.python-version}}
run: |
./sandbox/bin/pip uninstall -y setuptools
./sandbox/bin/pip install -e "git+https://github.com/pypa/setuptools.git#egg=setuptools"
ls ../sandbox/lib/python${PYTHON_VERSION}/site-packages
- name: Run buildout - name: Run buildout
env: env:
PACKAGE: ${{matrix.package}} PACKAGE: ${{matrix.package}}
PYTHON_VERSION: ${{matrix.python-version}} PYTHON_VERSION: ${{matrix.python-version}}
SETUPTOOLS_USE_DISTUTILS: stdlib
run: | run: |
sandbox/bin/buildout -v -c .github/workflows/scripts-${PYTHON_VERSION}.cfg annotate buildout sandbox/bin/buildout -v -c .github/workflows/scripts-${PYTHON_VERSION}.cfg annotate buildout
sandbox/bin/buildout -c .github/workflows/scripts-${PYTHON_VERSION}.cfg sandbox/bin/buildout -c .github/workflows/scripts-${PYTHON_VERSION}.cfg
......
...@@ -9,7 +9,7 @@ jobs: ...@@ -9,7 +9,7 @@ jobs:
strategy: strategy:
max-parallel: 4 max-parallel: 4
matrix: matrix:
python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10"] python-version: ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10"]
package: [zest.releaser, pyspf] package: [zest.releaser, pyspf]
steps: steps:
...@@ -20,11 +20,12 @@ jobs: ...@@ -20,11 +20,12 @@ jobs:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- name: Setup buildout virtualenv - name: Setup buildout virtualenv
run: | run: |
make -f .github/workflows/Makefile sandbox/bin/buildout make -f .github/workflows/Makefile-scripts sandbox/bin/buildout
- name: Run buildout - name: Run buildout
env: env:
PACKAGE: ${{matrix.package}} PACKAGE: ${{matrix.package}}
PYTHON_VERSION: ${{matrix.python-version}} PYTHON_VERSION: ${{matrix.python-version}}
SETUPTOOLS_USE_DISTUTILS: stdlib
run: | run: |
sandbox/bin/buildout -v -c .github/workflows/scripts-${PYTHON_VERSION}.cfg annotate buildout sandbox/bin/buildout -v -c .github/workflows/scripts-${PYTHON_VERSION}.cfg annotate buildout
sandbox/bin/buildout -c .github/workflows/scripts-${PYTHON_VERSION}.cfg sandbox/bin/buildout -c .github/workflows/scripts-${PYTHON_VERSION}.cfg
......
...@@ -5,6 +5,7 @@ PYTHON_BUILD_DIR = $(HERE)/python_builds ...@@ -5,6 +5,7 @@ PYTHON_BUILD_DIR = $(HERE)/python_builds
PLATFORM = $(shell uname) PLATFORM = $(shell uname)
VENV = $(HERE)/venvs/$(PYTHON_VER) VENV = $(HERE)/venvs/$(PYTHON_VER)
BUILD_VARIABLES = BUILD_VARIABLES =
PYTHONWARNINGS = "ignore:Setuptools is replacing distutils,ignore:setup.py install is deprecated,ignore:easy_install command is deprecated"
ifeq ($(PYTHON_VER),2.7) ifeq ($(PYTHON_VER),2.7)
PYTHON_MINOR ?= 2.7.18 PYTHON_MINOR ?= 2.7.18
...@@ -109,7 +110,7 @@ coverage: $(VENV)/bin/coverage $(VENV)/bin/test ...@@ -109,7 +110,7 @@ coverage: $(VENV)/bin/coverage $(VENV)/bin/test
COVERAGE_REPORT= RUN_COVERAGE= $(VENV)/bin/test $(testargs) COVERAGE_REPORT= RUN_COVERAGE= $(VENV)/bin/test $(testargs)
test: $(VENV)/bin/test test: $(VENV)/bin/test
$(VENV)/bin/test -c -vvv $(testargs) PYTHONWARNINGS=$(PYTHONWARNINGS) $(VENV)/bin/test -c -vvv $(testargs)
all_pythons: all_pythons:
$(MAKE) PYTHON_VER=2.7 python $(MAKE) PYTHON_VER=2.7 python
......
include Makefile
test_with_coverage:
PYTHONWARNINGS=$(PYTHONWARNINGS) bin/test -c -vvv
test_without_coverage:
PYTHONWARNINGS=$(PYTHONWARNINGS) RUN_COVERAGE= COVERAGE_REPORT= /home/buildout/sandbox/bin/test -c -vvv
...@@ -9,4 +9,4 @@ cd ../.. ...@@ -9,4 +9,4 @@ cd ../..
# which breaks test suite # which breaks test suite
pip${PYTHON_VER} uninstall -y six || true pip${PYTHON_VER} uninstall -y six || true
python${PYTHON_VER} dev.py python${PYTHON_VER} dev.py
bin/test -c -vvv make -f Makefile.builds test_with_coverage
...@@ -5,4 +5,4 @@ set -e ...@@ -5,4 +5,4 @@ set -e
cd ../.. cd ../..
docker build -f .github/workflows/Dockerfile --tag centos_buildout:python${PYTHON_VER} --build-arg PYTHON_VER=${PYTHON_VER} . docker build -f .github/workflows/Dockerfile --tag centos_buildout:python${PYTHON_VER} --build-arg PYTHON_VER=${PYTHON_VER} .
docker run centos_buildout:python${PYTHON_VER} /bin/bash -c 'RUN_COVERAGE= COVERAGE_REPORT= /home/buildout/sandbox/bin/test -c -vvv' docker run "centos_buildout:python${PYTHON_VER}" make -f Makefile.builds test_without_coverage
...@@ -5,4 +5,4 @@ set -e ...@@ -5,4 +5,4 @@ set -e
cd ../.. cd ../..
docker build -f .github/workflows/Dockerfile-debian --tag debian_buildout:python${PYTHON_VER} --build-arg PYTHON_VER=${PYTHON_VER} . docker build -f .github/workflows/Dockerfile-debian --tag debian_buildout:python${PYTHON_VER} --build-arg PYTHON_VER=${PYTHON_VER} .
docker run debian_buildout:python${PYTHON_VER} /bin/bash -c 'RUN_COVERAGE= COVERAGE_REPORT= /home/buildout/sandbox/bin/test -c -vvv' docker run "debian_buildout:python${PYTHON_VER}" make -f Makefile.builds test_without_coverage
...@@ -5,4 +5,4 @@ set -e ...@@ -5,4 +5,4 @@ set -e
cd ../.. cd ../..
docker build -f .github/workflows/Dockerfile-debian-system --tag debian_system_buildout . docker build -f .github/workflows/Dockerfile-debian-system --tag debian_system_buildout .
docker run debian_system_buildout /bin/bash -c 'RUN_COVERAGE= COVERAGE_REPORT= /home/buildout/sandbox/bin/test -c -vvv' docker run debian_system_buildout make -f Makefile.builds test_without_coverage
...@@ -27,6 +27,8 @@ if sys.version_info > (3, ) and sys.version_info < (3, 5): ...@@ -27,6 +27,8 @@ if sys.version_info > (3, ) and sys.version_info < (3, 5):
import os, shutil, subprocess, tempfile import os, shutil, subprocess, tempfile
os.environ["SETUPTOOLS_USE_DISTUTILS"] = "stdlib"
for d in 'eggs', 'develop-eggs', 'bin', 'parts': for d in 'eggs', 'develop-eggs', 'bin', 'parts':
if not os.path.exists(d): if not os.path.exists(d):
os.mkdir(d) os.mkdir(d)
......
...@@ -41,6 +41,8 @@ patch_Distribution() ...@@ -41,6 +41,8 @@ patch_Distribution()
def patch_PackageIndex(): def patch_PackageIndex():
try: try:
import logging
logging.getLogger('pip._internal.index.collector').setLevel(logging.ERROR)
from setuptools.package_index import PackageIndex from setuptools.package_index import PackageIndex
from setuptools.package_index import URL_SCHEME from setuptools.package_index import URL_SCHEME
from setuptools.package_index import HREF from setuptools.package_index import HREF
......
...@@ -1213,7 +1213,7 @@ distribution: ...@@ -1213,7 +1213,7 @@ distribution:
>>> zc.buildout.easy_install.build( >>> zc.buildout.easy_install.build(
... 'extdemo', dest, ... 'extdemo', dest,
... {'include-dirs': os.path.join(sample_buildout, 'include')}, ... {'include_dirs': os.path.join(sample_buildout, 'include')},
... links=[link_server], index=link_server+'index/') ... links=[link_server], index=link_server+'index/')
['/sample-install/extdemo-1.4-py2.4-unix-i686.egg'] ['/sample-install/extdemo-1.4-py2.4-unix-i686.egg']
...@@ -1259,7 +1259,7 @@ If we run build with newest set to False, we won't get an update: ...@@ -1259,7 +1259,7 @@ If we run build with newest set to False, we won't get an update:
>>> zc.buildout.easy_install.build( >>> zc.buildout.easy_install.build(
... 'extdemo', dest, ... 'extdemo', dest,
... {'include-dirs': os.path.join(sample_buildout, 'include')}, ... {'include_dirs': os.path.join(sample_buildout, 'include')},
... links=[link_server], index=link_server+'index/', ... links=[link_server], index=link_server+'index/',
... newest=False) ... newest=False)
['/sample-install/extdemo-1.4-py2.4-linux-i686.egg'] ['/sample-install/extdemo-1.4-py2.4-linux-i686.egg']
...@@ -1276,7 +1276,7 @@ get an updated egg: ...@@ -1276,7 +1276,7 @@ get an updated egg:
>>> zc.buildout.easy_install.build( >>> zc.buildout.easy_install.build(
... 'extdemo', dest, ... 'extdemo', dest,
... {'include-dirs': os.path.join(sample_buildout, 'include')}, ... {'include_dirs': os.path.join(sample_buildout, 'include')},
... links=[link_server], index=link_server+'index/') ... links=[link_server], index=link_server+'index/')
['/sample-install/extdemo-1.5-py2.4-unix-i686.egg'] ['/sample-install/extdemo-1.5-py2.4-unix-i686.egg']
...@@ -1299,7 +1299,7 @@ first: ...@@ -1299,7 +1299,7 @@ first:
>>> zc.buildout.easy_install.build( >>> zc.buildout.easy_install.build(
... 'extdemo', dest, ... 'extdemo', dest,
... {'include-dirs': os.path.join(sample_buildout, 'include')}, ... {'include_dirs': os.path.join(sample_buildout, 'include')},
... links=[link_server], index=link_server+'index/', ... links=[link_server], index=link_server+'index/',
... versions=dict(extdemo='1.4')) ... versions=dict(extdemo='1.4'))
['/sample-install/extdemo-1.4-py2.4-unix-i686.egg'] ['/sample-install/extdemo-1.4-py2.4-unix-i686.egg']
...@@ -1331,19 +1331,22 @@ build_ext ...@@ -1331,19 +1331,22 @@ build_ext
We have a local directory containing the extdemo source: We have a local directory containing the extdemo source:
>>> ls(extdemo) >>> contents = os.listdir(extdemo)
- MANIFEST >>> 'MANIFEST.in' in contents
- MANIFEST.in True
- README >>> 'README' in contents
- extdemo.c True
- setup.py >>> 'extdemo.c' in contents
True
>>> 'setup.py' in contents
True
Now, we can use the develop function to create a develop egg from the source Now, we can use the develop function to create a develop egg from the source
distribution: distribution:
>>> zc.buildout.easy_install.develop( >>> zc.buildout.easy_install.develop(
... extdemo, dest, ... extdemo, dest,
... {'include-dirs': os.path.join(sample_buildout, 'include')}) ... {'include_dirs': os.path.join(sample_buildout, 'include')})
'/sample-install/extdemo.egg-link' '/sample-install/extdemo.egg-link'
The name of the egg link created is returned. The name of the egg link created is returned.
...@@ -1407,7 +1410,7 @@ Now, if we install demo, and extdemo: ...@@ -1407,7 +1410,7 @@ Now, if we install demo, and extdemo:
>>> zc.buildout.easy_install.build( >>> zc.buildout.easy_install.build(
... 'extdemo', dest, ... 'extdemo', dest,
... {'include-dirs': os.path.join(sample_buildout, 'include')}, ... {'include_dirs': os.path.join(sample_buildout, 'include')},
... links=[link_server], index=link_server+'index/') ... links=[link_server], index=link_server+'index/')
GET 404 /index/extdemo/ GET 404 /index/extdemo/
GET 200 /extdemo-1.5.zip GET 200 /extdemo-1.5.zip
...@@ -1448,7 +1451,7 @@ Now when we install the distributions: ...@@ -1448,7 +1451,7 @@ Now when we install the distributions:
>>> zc.buildout.easy_install.build( >>> zc.buildout.easy_install.build(
... 'extdemo', dest, ... 'extdemo', dest,
... {'include-dirs': os.path.join(sample_buildout, 'include')}, ... {'include_dirs': os.path.join(sample_buildout, 'include')},
... links=[link_server], index=link_server+'index/') ... links=[link_server], index=link_server+'index/')
GET 404 /index/extdemo/ GET 404 /index/extdemo/
['/sample-install/extdemo-1.5-py2.4-linux-i686.egg'] ['/sample-install/extdemo-1.5-py2.4-linux-i686.egg']
......
...@@ -2282,7 +2282,6 @@ We'll create a wacky buildout extension that just announces itself when used: ...@@ -2282,7 +2282,6 @@ We'll create a wacky buildout extension that just announces itself when used:
Now we'll create a buildout that uses this extension to load other packages: Now we'll create a buildout that uses this extension to load other packages:
>>> wacky_server = link_server.replace('http', 'wacky')
>>> dist = 'file://' + join(src, 'dist').replace(os.path.sep, '/') >>> dist = 'file://' + join(src, 'dist').replace(os.path.sep, '/')
>>> write('buildout.cfg', >>> write('buildout.cfg',
... ''' ... '''
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment