Skip to content

Commit 5fe95c6

Browse files
authored
Alternate Ubuntu CI fix (pandas-dev#50117)
* Revert "CI try using ubuntu20.04 (pandas-dev#50113)" This reverts commit 03a981a. * removed dead cython code * fix warning * ci to ubuntu 22.04 * cython fixups
1 parent e38daf0 commit 5fe95c6

16 files changed

+24
-42
lines changed

.github/workflows/32-bit-linux.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ permissions:
1717

1818
jobs:
1919
pytest:
20-
runs-on: ubuntu-20.04
20+
runs-on: ubuntu-22.04
2121
steps:
2222
- name: Checkout
2323
uses: actions/checkout@v3

.github/workflows/assign.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
permissions:
1212
issues: write
1313
pull-requests: write
14-
runs-on: ubuntu-20.04
14+
runs-on: ubuntu-22.04
1515
steps:
1616
- if: github.event.comment.body == 'take'
1717
run: |

.github/workflows/asv-bot.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
name: "Run benchmarks"
2222
# TODO: Support more benchmarking options later, against different branches, against self, etc
2323
if: startsWith(github.event.comment.body, '@github-actions benchmark')
24-
runs-on: ubuntu-20.04
24+
runs-on: ubuntu-22.04
2525
defaults:
2626
run:
2727
shell: bash -el {0}

.github/workflows/autoupdate-pre-commit-config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
pull-requests: write # for technote-space/create-pr-action to create a PR
1616
if: github.repository_owner == 'pandas-dev'
1717
name: Autoupdate pre-commit config
18-
runs-on: ubuntu-20.04
18+
runs-on: ubuntu-22.04
1919
steps:
2020
- name: Set up Python
2121
uses: actions/setup-python@v4

.github/workflows/code-checks.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ permissions:
2020
jobs:
2121
pre_commit:
2222
name: pre-commit
23-
runs-on: ubuntu-20.04
23+
runs-on: ubuntu-22.04
2424
concurrency:
2525
# https://github.community/t/concurrecy-not-work-for-push/183068/7
2626
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-pre-commit
@@ -41,7 +41,7 @@ jobs:
4141

4242
docstring_typing_pylint:
4343
name: Docstring validation, typing, and pylint
44-
runs-on: ubuntu-20.04
44+
runs-on: ubuntu-22.04
4545
defaults:
4646
run:
4747
shell: bash -el {0}
@@ -104,7 +104,7 @@ jobs:
104104

105105
asv-benchmarks:
106106
name: ASV Benchmarks
107-
runs-on: ubuntu-20.04
107+
runs-on: ubuntu-22.04
108108
defaults:
109109
run:
110110
shell: bash -el {0}
@@ -135,7 +135,7 @@ jobs:
135135
136136
build_docker_dev_environment:
137137
name: Build Docker Dev Environment
138-
runs-on: ubuntu-20.04
138+
runs-on: ubuntu-22.04
139139
defaults:
140140
run:
141141
shell: bash -el {0}
@@ -162,7 +162,7 @@ jobs:
162162

163163
requirements-dev-text-installable:
164164
name: Test install requirements-dev.txt
165-
runs-on: ubuntu-20.04
165+
runs-on: ubuntu-22.04
166166

167167
concurrency:
168168
# https://github.community/t/concurrecy-not-work-for-push/183068/7

.github/workflows/codeql.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ concurrency:
1010

1111
jobs:
1212
analyze:
13-
runs-on: ubuntu-20.04
13+
runs-on: ubuntu-22.04
1414
permissions:
1515
actions: read
1616
contents: read

.github/workflows/docbuild-and-upload.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ permissions:
2222
jobs:
2323
web_and_docs:
2424
name: Doc Build and Upload
25-
runs-on: ubuntu-20.04
25+
runs-on: ubuntu-22.04
2626

2727
concurrency:
2828
# https://github.community/t/concurrecy-not-work-for-push/183068/7

.github/workflows/package-checks.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ permissions:
1717
jobs:
1818
pip:
1919
if: ${{ github.event.label.name == 'Build' || contains(github.event.pull_request.labels.*.name, 'Build') || github.event_name == 'push'}}
20-
runs-on: ubuntu-20.04
20+
runs-on: ubuntu-22.04
2121
strategy:
2222
matrix:
2323
extra: ["test", "performance", "timezone", "computation", "fss", "aws", "gcp", "excel", "parquet", "feather", "hdf5", "spss", "postgresql", "mysql", "sql-other", "html", "xml", "plot", "output_formatting", "clipboard", "compression", "all"]

.github/workflows/python-dev.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
strategy:
5050
fail-fast: false
5151
matrix:
52-
os: [ubuntu-20.04, macOS-latest, windows-latest]
52+
os: [ubuntu-22.04, macOS-latest, windows-latest]
5353

5454
name: actions-311-dev
5555
timeout-minutes: 120

.github/workflows/scorecards.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ permissions: read-all
1313
jobs:
1414
analysis:
1515
name: Scorecards analysis
16-
runs-on: ubuntu-20.04
16+
runs-on: ubuntu-22.04
1717
permissions:
1818
# Needed to upload the results to code-scanning dashboard.
1919
security-events: write

.github/workflows/sdist.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ permissions:
1919
jobs:
2020
build:
2121
if: ${{ github.event.label.name == 'Build' || contains(github.event.pull_request.labels.*.name, 'Build') || github.event_name == 'push'}}
22-
runs-on: ubuntu-20.04
22+
runs-on: ubuntu-22.04
2323
timeout-minutes: 60
2424
defaults:
2525
run:

.github/workflows/stale-pr.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
stale:
1212
permissions:
1313
pull-requests: write
14-
runs-on: ubuntu-20.04
14+
runs-on: ubuntu-22.04
1515
steps:
1616
- uses: actions/stale@v4
1717
with:

.github/workflows/ubuntu.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ permissions:
2020

2121
jobs:
2222
pytest:
23-
runs-on: ubuntu-20.04
23+
runs-on: ubuntu-22.04
2424
defaults:
2525
run:
2626
shell: bash -el {0}

.github/workflows/wheels.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ jobs:
127127
(github.event_name == 'pull_request' &&
128128
contains(github.event.pull_request.labels.*.name, 'Build')) ||
129129
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && ( ! endsWith(github.ref, 'dev0')))
130-
runs-on: ubuntu-20.04
130+
runs-on: ubuntu-22.04
131131
env:
132132
IS_PUSH: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
133133
IS_SCHEDULE_DISPATCH: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}

pandas/_libs/tslibs/offsets.pyx

+3-1
Original file line numberDiff line numberDiff line change
@@ -4132,7 +4132,9 @@ def shift_months(
41324132

41334133
cnp.broadcast mi = cnp.PyArray_MultiIterNew2(out, dtindex)
41344134

4135-
if day_opt not in [None, "start", "end", "business_start", "business_end"]:
4135+
if day_opt is not None and day_opt not in {
4136+
"start", "end", "business_start", "business_end"
4137+
}:
41364138
raise ValueError("day must be None, 'start', 'end', "
41374139
"'business_start', or 'business_end'")
41384140

pandas/_libs/tslibs/parsing.pyx

+3-23
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ from cpython.datetime cimport (
1212
datetime,
1313
datetime_new,
1414
import_datetime,
15-
tzinfo,
1615
)
1716
from cpython.object cimport PyObject_Str
1817
from cython cimport Py_ssize_t
@@ -44,7 +43,6 @@ from dateutil.relativedelta import relativedelta
4443
from dateutil.tz import (
4544
tzlocal as _dateutil_tzlocal,
4645
tzoffset,
47-
tzstr as _dateutil_tzstr,
4846
tzutc as _dateutil_tzutc,
4947
)
5048

@@ -444,7 +442,7 @@ cdef parse_datetime_string_with_reso(
444442
try:
445443
parsed, reso = dateutil_parse(date_string, _DEFAULT_DATETIME,
446444
dayfirst=dayfirst, yearfirst=yearfirst,
447-
ignoretz=False, tzinfos=None)
445+
ignoretz=False)
448446
except (ValueError, OverflowError) as err:
449447
# TODO: allow raise of errors within instead
450448
raise DateParseError(err)
@@ -636,7 +634,6 @@ cdef dateutil_parse(
636634
str timestr,
637635
object default,
638636
bint ignoretz=False,
639-
object tzinfos=None,
640637
bint dayfirst=False,
641638
bint yearfirst=False,
642639
):
@@ -645,7 +642,7 @@ cdef dateutil_parse(
645642
cdef:
646643
str attr
647644
datetime ret
648-
object res, tzdata
645+
object res
649646
object reso = None
650647
dict repl = {}
651648

@@ -674,24 +671,7 @@ cdef dateutil_parse(
674671
if res.weekday is not None and not res.day:
675672
ret = ret + relativedelta.relativedelta(weekday=res.weekday)
676673
if not ignoretz:
677-
if callable(tzinfos) or tzinfos and res.tzname in tzinfos:
678-
# Note: as of 1.0 this is not reached because
679-
# we never pass tzinfos, see GH#22234
680-
if callable(tzinfos):
681-
tzdata = tzinfos(res.tzname, res.tzoffset)
682-
else:
683-
tzdata = tzinfos.get(res.tzname)
684-
if isinstance(tzdata, tzinfo):
685-
new_tzinfo = tzdata
686-
elif isinstance(tzdata, str):
687-
new_tzinfo = _dateutil_tzstr(tzdata)
688-
elif isinstance(tzdata, int):
689-
new_tzinfo = tzoffset(res.tzname, tzdata)
690-
else:
691-
raise ValueError("offset must be tzinfo subclass, "
692-
"tz string, or int offset")
693-
ret = ret.replace(tzinfo=new_tzinfo)
694-
elif res.tzname and res.tzname in time.tzname:
674+
if res.tzname and res.tzname in time.tzname:
695675
ret = ret.replace(tzinfo=_dateutil_tzlocal())
696676
elif res.tzoffset == 0:
697677
ret = ret.replace(tzinfo=_dateutil_tzutc())

0 commit comments

Comments
 (0)