Skip to content

Commit 0eb4534

Browse files
committed
TP works on python 3.10.
Match statements are not implemented (nor are keyword-only arguments), but the core runs on this platform. At some point, need to implement these other features.
1 parent f959de5 commit 0eb4534

24 files changed

+1572
-43
lines changed

.activate

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# brief shell script to activate the python-version-specific
2+
# virtual environments that are built by the makefile.
3+
#
4+
# usage: in a bash shell, type
5+
#
6+
# make install # if you havn't already done so
7+
# . .activate
8+
#
9+
# and you'll get popped into a virtualenv appropriate for your installed version of python
10+
11+
PYTHON_VERSION=`python3 -c 'import sys; print("3_" + str(sys.version_info.minor))'`
12+
13+
echo "Using python environment .venv_$PYTHON_VERSION"
14+
15+
. .venv_$PYTHON_VERSION/bin/activate
16+
. .env_$PYTHON_VERSION

.github/workflows/python-package.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ jobs:
1111
strategy:
1212
matrix:
1313
os: [ubuntu-latest, macos-10.15]
14-
python-version: [3.7, 3.8, 3.9]
14+
python-version: [3.7, 3.8, 3.9, '3.10']
1515
exclude:
1616
- os: macos-10.15
1717
python-version: 3.8
1818
- os: macos-10.15
1919
python-version: 3.9
20+
- os: macos-10.15
21+
python-version: '3.10'
2022
steps:
2123
- uses: actions/checkout@v2
2224

@@ -73,12 +75,14 @@ jobs:
7375
strategy:
7476
matrix:
7577
os: [ubuntu-latest, macos-10.15]
76-
python-version: [3.7, 3.8, 3.9]
78+
python-version: [3.7, 3.8, 3.9, '3.10']
7779
exclude:
7880
- os: macos-10.15
7981
python-version: 3.8
8082
- os: macos-10.15
8183
python-version: 3.9
84+
- os: macos-10.15
85+
python-version: '3.10'
8286
steps:
8387
- name: Set up Python ${{ matrix.python-version }}
8488
uses: actions/setup-python@v2

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ object_database/web/content/dist
1818

1919
# leading slash means only match at repo-root level
2020
/.python-version
21-
/.venv
21+
/.venv*
2222
/.eggs
2323
/.coverage*
2424
/.tox
25-
/.env
25+
/.env*
2626
/dist/
2727
/pip-wheel-metadata/
2828
/testcert.cert

Makefile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@ PYTHON_VERSION = $(shell python3 -c 'import sys; print("3_" + str(sys.version_in
1212

1313
# Path to virtual environment(s)
1414
VIRTUAL_ENV ?= .venv_$(PYTHON_VERSION)
15+
ENV ?= .env_$(PYTHON_VERSION)
1516
NODE_ENV ?= .nodeenv
1617

18+
PIPENV_PIPFILE ?= Pipfile_$(PYTHON_VERSION)
19+
1720
TP_SRC_PATH ?= typed_python
1821

1922
TP_BUILD_PATH ?= build/temp.linux-x86_64/typed_python
@@ -65,6 +68,7 @@ install: install-dependencies install-pre-commit
6568
.ONESHELL:
6669
install-dependencies: $(VIRTUAL_ENV)
6770
. $(VIRTUAL_ENV)/bin/activate; \
71+
export PIPENV_PIPFILE=$(PIPENV_PIPFILE); \
6872
pipenv install --dev --deploy
6973

7074

@@ -107,23 +111,24 @@ clean:
107111
rm -rf typed_python.egg-info/
108112
rm -f nose.*.log
109113
rm -f typed_python/_types.cpython-*.so
110-
rm -rf $(VIRTUAL_ENV) .env
114+
rm -rf $(VIRTUAL_ENV) $(ENV)
111115
rm -f .coverage*
112116
rm -fr dist
113117

114118

115119
##########################################################################
116120
# HELPER RULES
117121

118-
.env:
119-
echo "NOTICE: File Auto-generated by Makefile" > $@
122+
$(ENV):
123+
echo "# NOTICE: File Auto-generated by Makefile" > $@
120124
echo "export COVERAGE_PROCESS_START=$(PWD)/tox.ini" >> $@
121125
echo "export PYTHONPATH=$(PWD)" >> $@
122126

123127
.ONESHELL:
124-
$(VIRTUAL_ENV): $(PYTHON) .env
128+
$(VIRTUAL_ENV): $(PYTHON) $(ENV)
125129
$(PYTHON) -m venv $(VIRTUAL_ENV); \
126130
. $(VIRTUAL_ENV)/bin/activate; \
131+
export PIPENV_PIPFILE=$(PIPENV_PIPFILE); \
127132
pip install -U pip; \
128133
pip install pipenv; \
129134
pip install wheel;

Pipfile_3_10

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[[source]]
2+
name = "pypi"
3+
url = "https://pypi.org/simple"
4+
verify_ssl = true
5+
6+
[dev-packages]
7+
autopep8 = "*"
8+
beautifulsoup4 = "*"
9+
flake8 = "*"
10+
pytest = "*"
11+
pre-commit = "*"
12+
flaky = "*"
13+
pytest-cov = "*"
14+
15+
[packages]
16+
sortedcontainers = "*"
17+
scipy = "==1.8.0"
18+
llvmlite = "==0.38.0"
19+
numpy = "==1.22"
20+
psutil = "*"
21+
pytz = "*"
22+
typed_python = {editable = true, path = "."}

Pipfile_3_10.lock

Lines changed: 438 additions & 0 deletions
Large diffs are not rendered by default.
File renamed without changes.

Pipfile_3_7.lock

Lines changed: 470 additions & 0 deletions
Large diffs are not rendered by default.

Pipfile_3_8

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[[source]]
2+
name = "pypi"
3+
url = "https://pypi.org/simple"
4+
verify_ssl = true
5+
6+
[dev-packages]
7+
autopep8 = "*"
8+
beautifulsoup4 = "*"
9+
flake8 = "*"
10+
pytest = "*"
11+
pre-commit = "*"
12+
flaky = "*"
13+
pytest-cov = "*"
14+
15+
[packages]
16+
sortedcontainers = "*"
17+
llvmlite = "==0.36.0"
18+
numpy = "<1.20"
19+
psutil = "*"
20+
pytz = "*"
21+
typed_python = {editable = true, path = "."}

Pipfile.lock renamed to Pipfile_3_8.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@
407407
"sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926",
408408
"sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"
409409
],
410-
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",
410+
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2'",
411411
"version": "==1.16.0"
412412
},
413413
"soupsieve": {
@@ -423,7 +423,7 @@
423423
"sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b",
424424
"sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"
425425
],
426-
"markers": "python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'",
426+
"markers": "python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2'",
427427
"version": "==0.10.2"
428428
},
429429
"tomli": {

0 commit comments

Comments
 (0)