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 useradd -ms /bin/bash buildout
USER buildout
......@@ -19,3 +19,4 @@ USER root
RUN chown -R buildout:buildout *
USER buildout
RUN make PYTHON_VER=${PYTHON_VER} build
COPY Makefile.builds /home/buildout/sandbox/
......@@ -20,3 +20,4 @@ USER root
RUN chown -R buildout:buildout *
USER buildout
RUN make PYTHON_VER=${PYTHON_VER} build
COPY Makefile.builds /home/buildout/sandbox/
FROM debian:stable-slim as debian-python
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
USER buildout
RUN mkdir /home/buildout/sandbox
......@@ -15,3 +15,4 @@ USER root
RUN chown -R buildout:buildout *
USER buildout
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:
with:
path: eggs
key: ${{ matrix.os }}-{{ matrix.python-version }}-eggs
- name: Install dev environment
run: |
python dev.py
- name: Run tests
env:
TMPDIR: ${{ env.HOME }}/AppData/Local/Temp
TMP: ${{ env.HOME }}/AppData/Local/Temp
TEMP: ${{ env.HOME }}/AppData/Local/Temp
BUILD_TYPE: bare_machines
run: |
echo $TMPDIR
bin/test -c -vvv
./ci_build.sh
......@@ -22,18 +22,12 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Setup buildout virtualenv
run: |
make -f .github/workflows/Makefile 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
make -f .github/workflows/Makefile-scripts-setuptools-head sandbox/bin/buildout
- name: Run buildout
env:
PACKAGE: ${{matrix.package}}
PYTHON_VERSION: ${{matrix.python-version}}
SETUPTOOLS_USE_DISTUTILS: stdlib
run: |
sandbox/bin/buildout -v -c .github/workflows/scripts-${PYTHON_VERSION}.cfg annotate buildout
sandbox/bin/buildout -c .github/workflows/scripts-${PYTHON_VERSION}.cfg
......
......@@ -9,7 +9,7 @@ jobs:
strategy:
max-parallel: 4
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]
steps:
......@@ -20,11 +20,12 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Setup buildout virtualenv
run: |
make -f .github/workflows/Makefile sandbox/bin/buildout
make -f .github/workflows/Makefile-scripts sandbox/bin/buildout
- name: Run buildout
env:
PACKAGE: ${{matrix.package}}
PYTHON_VERSION: ${{matrix.python-version}}
SETUPTOOLS_USE_DISTUTILS: stdlib
run: |
sandbox/bin/buildout -v -c .github/workflows/scripts-${PYTHON_VERSION}.cfg annotate buildout
sandbox/bin/buildout -c .github/workflows/scripts-${PYTHON_VERSION}.cfg
......
......@@ -5,6 +5,7 @@ PYTHON_BUILD_DIR = $(HERE)/python_builds
PLATFORM = $(shell uname)
VENV = $(HERE)/venvs/$(PYTHON_VER)
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)
PYTHON_MINOR ?= 2.7.18
......@@ -109,7 +110,7 @@ coverage: $(VENV)/bin/coverage $(VENV)/bin/test
COVERAGE_REPORT= RUN_COVERAGE= $(VENV)/bin/test $(testargs)
test: $(VENV)/bin/test
$(VENV)/bin/test -c -vvv $(testargs)
PYTHONWARNINGS=$(PYTHONWARNINGS) $(VENV)/bin/test -c -vvv $(testargs)
all_pythons:
$(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 ../..
# which breaks test suite
pip${PYTHON_VER} uninstall -y six || true
python${PYTHON_VER} dev.py
bin/test -c -vvv
make -f Makefile.builds test_with_coverage
......@@ -5,4 +5,4 @@ set -e
cd ../..
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
cd ../..
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
cd ../..
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):
import os, shutil, subprocess, tempfile
os.environ["SETUPTOOLS_USE_DISTUTILS"] = "stdlib"
for d in 'eggs', 'develop-eggs', 'bin', 'parts':
if not os.path.exists(d):
os.mkdir(d)
......
......@@ -41,6 +41,8 @@ patch_Distribution()
def patch_PackageIndex():
try:
import logging
logging.getLogger('pip._internal.index.collector').setLevel(logging.ERROR)
from setuptools.package_index import PackageIndex
from setuptools.package_index import URL_SCHEME
from setuptools.package_index import HREF
......
......@@ -1213,7 +1213,7 @@ distribution:
>>> zc.buildout.easy_install.build(
... '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/')
['/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:
>>> zc.buildout.easy_install.build(
... '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/',
... newest=False)
['/sample-install/extdemo-1.4-py2.4-linux-i686.egg']
......@@ -1276,7 +1276,7 @@ get an updated egg:
>>> zc.buildout.easy_install.build(
... '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/')
['/sample-install/extdemo-1.5-py2.4-unix-i686.egg']
......@@ -1299,7 +1299,7 @@ first:
>>> zc.buildout.easy_install.build(
... '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/',
... versions=dict(extdemo='1.4'))
['/sample-install/extdemo-1.4-py2.4-unix-i686.egg']
......@@ -1331,19 +1331,22 @@ build_ext
We have a local directory containing the extdemo source:
>>> ls(extdemo)
- MANIFEST
- MANIFEST.in
- README
- extdemo.c
- setup.py
>>> contents = os.listdir(extdemo)
>>> 'MANIFEST.in' in contents
True
>>> 'README' in contents
True
>>> '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
distribution:
>>> zc.buildout.easy_install.develop(
... extdemo, dest,
... {'include-dirs': os.path.join(sample_buildout, 'include')})
... {'include_dirs': os.path.join(sample_buildout, 'include')})
'/sample-install/extdemo.egg-link'
The name of the egg link created is returned.
......@@ -1407,7 +1410,7 @@ Now, if we install demo, and extdemo:
>>> zc.buildout.easy_install.build(
... '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/')
GET 404 /index/extdemo/
GET 200 /extdemo-1.5.zip
......@@ -1448,7 +1451,7 @@ Now when we install the distributions:
>>> zc.buildout.easy_install.build(
... '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/')
GET 404 /index/extdemo/
['/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:
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, '/')
>>> 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