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

add python 3.10 #1

Closed
wants to merge 39 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
5889c85
fix ci in dirty way
hirosassa Oct 17, 2021
1174272
add python 3.10
hirosassa Oct 9, 2021
4147448
double quoted
hirosassa Oct 9, 2021
6ad7457
double quoted
hirosassa Oct 9, 2021
4efc150
reduce versions
hirosassa Oct 16, 2021
3261e11
reduce versions
hirosassa Oct 16, 2021
c8eb4a8
reduce versions
hirosassa Oct 16, 2021
c0df9db
reduce versions
hirosassa Oct 16, 2021
1719bbf
reduce versions
hirosassa Oct 16, 2021
17a690e
reduce versions
hirosassa Oct 24, 2021
78bd1d6
test
hirosassa Oct 31, 2021
6d594d5
test
hirosassa Oct 31, 2021
9e19046
test
hirosassa Oct 31, 2021
f272e12
test
hirosassa Oct 31, 2021
4b33ca2
test
hirosassa Oct 31, 2021
800df50
test
hirosassa Nov 3, 2021
d00f0f9
test
hirosassa Nov 3, 2021
84f74f7
test
hirosassa Nov 3, 2021
8b15a57
test
hirosassa Nov 3, 2021
e6aa9d8
test
hirosassa Nov 3, 2021
0f65431
test
hirosassa Nov 3, 2021
28b6afd
test
hirosassa Nov 3, 2021
9b1d51c
test
hirosassa Nov 3, 2021
8513067
test
hirosassa Nov 3, 2021
96b5187
test
hirosassa Nov 3, 2021
83ede81
test
hirosassa Nov 3, 2021
a61de46
test
hirosassa Nov 3, 2021
a28ebed
fixed
hirosassa Jan 17, 2022
03af2b6
Merge branch 'master' into support-python-3.10
hirosassa Jan 17, 2022
8ea31b0
tox version
hirosassa Jan 17, 2022
6f076e2
fix
hirosassa Jan 17, 2022
af564e6
add uname
hirosassa Jan 17, 2022
5efe2aa
add id
hirosassa Jan 17, 2022
be913e5
remove unnecessaries
hirosassa Jan 17, 2022
ae365b4
retry
hirosassa Jan 17, 2022
7dd590b
retry
hirosassa Jan 17, 2022
23c1c60
retry
hirosassa Jan 17, 2022
9719840
error handling
hirosassa Jan 17, 2022
aa999b1
add tenacity
hirosassa Jan 21, 2022
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
305 changes: 159 additions & 146 deletions .github/workflows/pythonbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@ jobs:
strategy:
matrix:
include:
- python-version: 3.6
tox-env: py36-core
- python-version: 3.7
tox-env: py37-core
- python-version: 3.8
tox-env: py38-core
- python-version: 3.9
tox-env: py39-core
# - python-version: "3.6"
# tox-env: py36-core
# - python-version: "3.7"
# tox-env: py37-core
# - python-version: "3.8"
# tox-env: py38-core
# - python-version: "3.9"
# tox-env: py39-core
- python-version: "3.10"
tox-env: py310-core

steps:
- uses: actions/checkout@v2
Expand All @@ -37,7 +39,7 @@ jobs:
key: ${{ format('{0}-pip-{1}', runner.os, hashFiles('dev-requirements.txt', format('requirements{0}.txt', matrix.spark-version-suffix))) }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip 'tox<3.0'
python -m pip install --upgrade pip 'tox<4.0'
- name: Setup MySQL DB
run: |
sudo /etc/init.d/mysql start
Expand All @@ -47,155 +49,166 @@ jobs:
- name: Build
env:
TOXENV: ${{ matrix.tox-env }}
run: tox
run: tox test/lock_test.py
- name: Codecov
env:
env:
COVERAGE_PROCESS_START: .coveragerc
run: |
pip install codecov
codecov -e ${{ matrix.tox-env }}

postgres:
runs-on: ubuntu-20.04
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
# postgres:
# runs-on: ubuntu-20.04
# services:
# postgres:
# image: postgres
# env:
# POSTGRES_USER: postgres
# POSTGRES_PASSWORD: postgres
# POSTGRES_DB: postgres
# ports:
# - 5432:5432
# # Set health checks to wait until postgres has started
# options: >-
# --health-cmd pg_isready
# --health-interval 10s
# --health-timeout 5s
# --health-retries 5

strategy:
matrix:
include:
- python-version: 3.6
tox-env: py36-postgres
- python-version: 3.7
tox-env: py37-postgres
- python-version: 3.8
tox-env: py38-postgres
- python-version: 3.9
tox-env: py39-postgres
# strategy:
# matrix:
# include:
# - python-version: "3.6"
# tox-env: py36-postgres
# - python-version: "3.7"
# tox-env: py37-postgres
# - python-version: "3.8"
# tox-env: py38-postgres
# - python-version: "3.9"
# tox-env: py39-postgres
# - python-version: "3.10"
# tox-env: py310-postgres

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip
uses: actions/cache@v2
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements files
key: ${{ format('{0}-pip-{1}', runner.os, hashFiles('dev-requirements.txt', format('requirements{0}.txt', matrix.spark-version-suffix))) }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip 'tox<3.0'
- name: Create PSQL database
run: |
PGPASSWORD=postgres psql -h localhost -p 5432 -c 'create database spotify;' -U postgres
- name: Build
env:
TOXENV: ${{ matrix.tox-env }}
run: tox
- name: Codecov
env:
COVERAGE_PROCESS_START: .coveragerc
run: |
pip install codecov
codecov -e ${{ matrix.tox-env }}
# steps:
# - uses: actions/checkout@v2
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v2
# with:
# python-version: ${{ matrix.python-version }}
# - name: Cache pip
# uses: actions/cache@v2
# with:
# # This path is specific to Ubuntu
# path: ~/.cache/pip
# # Look to see if there is a cache hit for the corresponding requirements files
# key: ${{ format('{0}-pip-{1}', runner.os, hashFiles('dev-requirements.txt', format('requirements{0}.txt', matrix.spark-version-suffix))) }}
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip 'tox<4.0'
# - name: Create PSQL database
# run: |
# PGPASSWORD=postgres psql -h localhost -p 5432 -c 'create database spotify;' -U postgres
# - name: Build
# env:
# TOXENV: ${{ matrix.tox-env }}
# run: tox
# - name: Codecov
# env:
# COVERAGE_PROCESS_START: .coveragerc
# run: |
# pip install codecov
# codecov -e ${{ matrix.tox-env }}

base:
runs-on: ubuntu-20.04
env:
AWS_DEFAULT_REGION: us-east-1
AWS_ACCESS_KEY_ID: accesskey
AWS_SECRET_ACCESS_KEY: secretkey
# base:
# runs-on: ubuntu-20.04
# env:
# AWS_DEFAULT_REGION: us-east-1
# AWS_ACCESS_KEY_ID: accesskey
# AWS_SECRET_ACCESS_KEY: secretkey

strategy:
matrix:
include:
- python-version: 3.6
tox-env: py36-aws
- python-version: 3.7
tox-env: py37-aws
- python-version: 3.8
tox-env: py38-aws
- python-version: 3.9
tox-env: py39-aws
# strategy:
# matrix:
# include:
# - python-version: "3.6"
# tox-env: py36-aws
# - python-version: "3.7"
# tox-env: py37-aws
# - python-version: "3.8"
# tox-env: py38-aws
# - python-version: "3.9"
# tox-env: py39-aws
# - python-version: "3.10"
# tox-env: py310-aws

- python-version: 3.6
tox-env: py36-unixsocket
OVERRIDE_SKIP_CI_TESTS: True
- python-version: 3.7
tox-env: py37-unixsocket
OVERRIDE_SKIP_CI_TESTS: True
- python-version: 3.8
tox-env: py38-unixsocket
OVERRIDE_SKIP_CI_TESTS: True
- python-version: 3.9
tox-env: py39-unixsocket
OVERRIDE_SKIP_CI_TESTS: True
# - python-version: "3.6"
# tox-env: py36-unixsocket
# OVERRIDE_SKIP_CI_TESTS: True
# - python-version: "3.7"
# tox-env: py37-unixsocket
# OVERRIDE_SKIP_CI_TESTS: True
# - python-version: "3.8"
# tox-env: py38-unixsocket
# OVERRIDE_SKIP_CI_TESTS: True
# - python-version: "3.9"
# tox-env: py39-unixsocket
# OVERRIDE_SKIP_CI_TESTS: True
# - python-version: "3.10"
# tox-env: py310-unixsocket
# OVERRIDE_SKIP_CI_TESTS: True

- python-version: 3.6
tox-env: py36-apache
- python-version: 3.7
tox-env: py37-apache
- python-version: 3.8
tox-env: py38-apache
- python-version: 3.9
tox-env: py39-apache

- python-version: 3.6
tox-env: py36-azureblob
- python-version: 3.7
tox-env: py37-azureblob
- python-version: 3.8
tox-env: py38-azureblob
- python-version: 3.9
tox-env: py39-azureblob
# - python-version: "3.6"
# tox-env: py36-apache
# - python-version: "3.7"
# tox-env: py37-apache
# - python-version: 3.8
# tox-env: py38-apache
# - python-version: 3.9
# tox-env: py39-apache
# - python-version: "3.10"
# tox-env: py310-apache

# - python-version: "3.6"
# tox-env: py36-azureblob
# - python-version: "3.7"
# tox-env: py37-azureblob
# - python-version: "3.8"
# tox-env: py38-azureblob
# - python-version: "3.9"
# tox-env: py39-azureblob
# - python-version: "3.10"
# tox-env: py310-azureblob

- python-version: 3.9
tox-env: flake8
- python-version: 3.9
tox-env: docs

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip
uses: actions/cache@v2
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements files
key: ${{ format('{0}-pip-{1}', runner.os, hashFiles('dev-requirements.txt', format('requirements{0}.txt', matrix.spark-version-suffix))) }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip 'tox<4.0'
- name: Build
env:
TOXENV: ${{ matrix.tox-env }}
OVERRIDE_SKIP_CI_TESTS: ${{ matrix.OVERRIDE_SKIP_CI_TESTS }}
run: tox
- name: Codecov
if: ${{ matrix.tox-env != 'flake8' && matrix.tox-env != 'docs' }}
env:
COVERAGE_PROCESS_START: .coveragerc
run: |
pip install codecov
codecov -e ${{ matrix.tox-env }}
# - python-version: "3.9"
# tox-env: flake8
# - python-version: "3.9"
# tox-env: docs

# steps:
# - uses: actions/checkout@v2
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v2
# with:
# python-version: ${{ matrix.python-version }}
# - name: Cache pip
# uses: actions/cache@v2
# with:
# # This path is specific to Ubuntu
# path: ~/.cache/pip
# # Look to see if there is a cache hit for the corresponding requirements files
# key: ${{ format('{0}-pip-{1}', runner.os, hashFiles('dev-requirements.txt', format('requirements{0}.txt', matrix.spark-version-suffix))) }}
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip 'tox<4.0'
# - name: Build
# env:
# TOXENV: ${{ matrix.tox-env }}
# OVERRIDE_SKIP_CI_TESTS: ${{ matrix.OVERRIDE_SKIP_CI_TESTS }}
# run: tox
# - name: Codecov
# if: ${{ matrix.tox-env != 'flake8' && matrix.tox-env != 'docs' }}
# env:
# COVERAGE_PROCESS_START: .coveragerc
# run: |
# pip install codecov
# codecov -e ${{ matrix.tox-env }}
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
.. image:: https://img.shields.io/pypi/l/luigi.svg?style=flat
:target: https://pypi.python.org/pypi/luigi

Luigi is a Python (3.6, 3.7, 3.8, 3.9 tested) package that helps you build complex
Luigi is a Python (3.6, 3.7, 3.8, 3.9, 3.10 tested) package that helps you build complex
pipelines of batch jobs. It handles dependency resolution, workflow management,
visualization, handling failures, command line integration, and much more.

Expand Down
16 changes: 14 additions & 2 deletions luigi/lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import os
import sys
from subprocess import Popen, PIPE
from tenacity import retry, retry_if_result, stop_after_attempt, wait_exponential, RetryError


def getpcmd(pid):
Expand Down Expand Up @@ -62,8 +63,9 @@ def getpcmd(pid):
# worked. See the pull request at
# https://github.com/spotify/luigi/pull/1876
try:
with open('/proc/{0}/cmdline'.format(pid), 'r') as fh:
return fh.read().replace('\0', ' ').rstrip()
return _proc(pid)
except RetryError:
pass
except IOError:
# the system may not allow reading the command line
# of a process owned by another user
Expand All @@ -73,6 +75,16 @@ def getpcmd(pid):
return '[PROCESS_WITH_PID={}]'.format(pid)


def _is_empty(s):
return s == ""


@retry(retry=retry_if_result(_is_empty), wait=wait_exponential(multiplier=1, min=1, max=10), stop=stop_after_attempt(5))
def _proc(pid):
with open('/proc/{0}/cmdline'.format(pid), 'r') as fh:
return fh.read().replace('\0', ' ').rstrip()


def get_info(pid_dir, my_pid=None):
# Check the name and pid of this process
if my_pid is None:
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ def get_static_files(path):
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Topic :: System :: Monitoring',
],
)
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{35,36,37,38,39}-{cdh,hdp,core,contrib,apache,aws,gcloud,postgres,unixsocket,azureblob,dropbox}, visualiser, docs, flake8
envlist = py{35,36,37,38,39,310}-{cdh,hdp,core,contrib,apache,aws,gcloud,postgres,unixsocket,azureblob,dropbox}, visualiser, docs, flake8
skipsdist = True

[pytest]
Expand Down