Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adds support for Python 3.10.0 #219

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 18 additions & 11 deletions .github/workflows/pyslurm.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,43 @@
name: PySlurm
on: [push, pull_request]
on:
push:
branches:
- main
pull_request: {}
jobs:
Build:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version:
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "3.6.15"
- "3.7.12"
- "3.8.12"
- "3.9.9"
- "3.10.0"
fail-fast: false
steps:
- name: Checkout repository code
uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install Dependencies
run: |
which python
which python${{ matrix.python-version }}
python${{ matrix.python-version }} -m pip install --upgrade pip
python${{ matrix.python-verison }} -m pip install pipenv
pipenv --python ${{matrix.python-version }} install --dev --skip-lock
python -m pip install --upgrade pip
python -m pip install pipenv
pipenv --python ${{ matrix.python-version }} install --dev --skip-lock

- name: Start Slurm Container
uses: sudo-bot/action-docker-compose@latest
with:
cli-args: "-f docker-compose-github.yml up -d"
env:
PYTHON: ${{ matrix.python-version }}

- name: Debug
run: |
docker ps -a
Expand All @@ -39,9 +46,9 @@ jobs:
ls -al
docker inspect slurmctl
env | sort

- name: Build/Install/Test PySlurm
run: |
pipenv run pytest -sv scripts/run_tests_in_container.py
env:
PYTHON: ${{ matrix.python-version }}

4 changes: 1 addition & 3 deletions docker-compose-github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ version: "3.8"

services:
slurm:
image: giovtorres/docker-centos7-slurm:20.11.8
image: giovtorres/docker-centos7-slurm:20.11.8-1
hostname: slurmctl
container_name: slurmctl
stdin_open: true
tty: true
working_dir: /pyslurm
environment:
PYTHON: "3.9"
volumes:
- ${RUNNER_WORKSPACE}/pyslurm:/pyslurm
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ version: "3.8"

services:
slurm:
image: giovtorres/docker-centos7-slurm:20.11.8
image: giovtorres/docker-centos7-slurm:20.11.8-1
hostname: slurmctl
container_name: slurmctl
stdin_open: true
tty: true
working_dir: /pyslurm
environment:
PYTHON: "3.9"
# environment:
# PYTHON: "3.9"
volumes:
- ${PWD}:/pyslurm
13 changes: 8 additions & 5 deletions scripts/run_tests_in_container.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
"""Execute pytest inside the container."""

import os
import sys

import testinfra


def test_run():
host = testinfra.get_host(f"docker://slurmctl")
python = f'python{os.environ.get("PYTHON")}'
print(host.check_output(f"{python} setup.py build"))
print(host.check_output(f"{python} setup.py install"))
python_full = os.environ.get("PYTHON")
python_short = ".".join([str(sys.version_info.major), str(sys.version_info.minor)])
print(host.check_output(f"pyenv global {python_full}"))
print(host.check_output(f"python{python_short} setup.py build"))
print(host.check_output(f"python{python_short} setup.py install"))
print(host.check_output("./scripts/configure.sh"))
print(host.check_output(f"{python} -m pip uninstall --yes pytest"))
print(host.check_output(f"{python} -m pip install pytest"))
print(host.check_output(f"python{python_short} -m pip uninstall --yes pytest"))
print(host.check_output(f"python{python_short} -m pip install pytest"))
print(host.check_output("pytest -v"))