Skip to content

Commit 95ddb8f

Browse files
committed
Remove Python 2.7, add Python 3.9
1 parent a17a307 commit 95ddb8f

9 files changed

Lines changed: 19 additions & 22 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,13 @@ On all major platforms, you can install directly from pip:
106106
pip install dss_python
107107
```
108108

109-
Or, if you're using the Anaconda distribution, you can use:
109+
Or, if you're using the Anaconda distribution, you can try:
110110

111111
```
112112
conda install -c pmeira dss_python
113113
```
114114

115-
Binary wheels are provided for all major platforms (Windows, Linux and MacOS) and many combinations of Python versions (2.7, 3.5 to 3.7). If you have issues with a specific version, please open an issue about it. Conda packages support at least Python 2.7, 3.5, 3.6 and 3.7.
115+
Binary wheels are provided for all major platforms (Windows, Linux and MacOS) and many combinations of Python versions (3.5 to 3.9). If you have issues with a specific version, please open an issue about it. Conda packages support at least Python 3.6, 3.7 and 3.8 (varying according to the release).
116116

117117
After a successful installation, you can then import the `dss` module from your Python interpreter.
118118

cffi/dss_capi_custom.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ void dss_custom_line_currents(double *line_norm_amps, int *all_line_nodes, doubl
3030
int n, node;
3131

3232
int32_t idx = Lines_Get_First();
33-
int32_t resultCount = 0;
33+
int32_t resultCount[2] = {0, 0};
3434

3535
while (idx > 0)
3636
{
@@ -39,7 +39,7 @@ void dss_custom_line_currents(double *line_norm_amps, int *all_line_nodes, doubl
3939

4040
norm_amps = line_norm_amps[idx - 1];
4141

42-
CktElement_Get_Currents(&currents, &resultCount);
42+
CktElement_Get_Currents(&currents, &resultCount[0]);
4343

4444
for (n = 0; n < 4; ++n)
4545
{

ci/build_linux.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ set -e -x
44
export DSS_PYTHON_MANYLINUX=1
55
cd /io/dss_python
66
for PYBIN in /opt/python/*/bin; do
7+
if [[ $PYBIN == *"cp27"* ]]
8+
then
9+
continue
10+
fi
11+
if [[ $PYBIN == *"cp34"* ]]
12+
then
13+
continue
14+
fi
715
rm -rf /io/dss_python/.eggs/
816
rm -rf /io/dss_python/build
917
"${PYBIN}/python" setup.py --quiet bdist_wheel

ci/build_osx.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ cd dss_python
1919

2020
# conda-build with wheels doesn't seem consistent so
2121
# we build the wheels manually
22-
for PYVERSION in 2.7 3.5 3.6 3.7 3.8; do
22+
for PYVERSION in 3.5 3.6 3.7 3.8 3.9; do
2323
echo Building for Python $PYVERSION...
2424
conda create -n py$PYVERSION python=$PYVERSION cffi
2525
source activate py$PYVERSION

ci/build_windows.sh

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,6 @@ ln -s /cygdrive/c /c
88
cd ..
99
export ARTIFACTS_FOLDER=`cygpath -a -w ./artifacts`
1010

11-
# Install Visual Studio Compiler for Python 2.7
12-
#choco install -y vcpython27
13-
if [ ! -f "/c/projects/VCForPython27.msi" ]; then
14-
$WGET https://download.microsoft.com/download/7/9/6/796EF2E4-801B-4FC4-AB28-B59FBF6D907B/VCForPython27.msi -q -O /c/projects/VCForPython27.msi
15-
fi
16-
cd dss_python/ci
17-
cmd "/c install_vcforpython27.bat"
18-
# rm -rf /c/projects/VCForPython27.msi
19-
cd ../..
20-
2111
export PATH="$PATH:/c/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin"
2212

2313
BUILD_WHEELS=1
@@ -30,9 +20,9 @@ if [ "$BUILD_WHEELS" == "1" ]; then
3020

3121
# Python 27 is kept last since we rebuild klusolve for it
3222
if [ "$CONDA_SUBDIR" == "win-32" ]; then
33-
PYTHON_VERSIONS="35 36 37 38 27"
23+
PYTHON_VERSIONS="35 36 37 38"
3424
else
35-
PYTHON_VERSIONS="35-x64 36-x64 37-x64 38-x64 27-x64"
25+
PYTHON_VERSIONS="35-x64 36-x64 37-x64 38-x64"
3626
fi
3727

3828
for A in $PYTHON_VERSIONS
@@ -62,7 +52,7 @@ if [ "$BUILD_WHEELS" == "1" ]; then
6252
# conda update -q conda
6353
# conda info -a
6454

65-
PYTHON_VERSIONS="2.7 3.5 3.6 3.7 3.8"
55+
PYTHON_VERSIONS="3.5 3.6 3.7 3.8 3.9"
6656

6757
for A in $PYTHON_VERSIONS
6858
do

ci/install_vcforpython27.bat

Lines changed: 0 additions & 1 deletion
This file was deleted.

conda/conda_build_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
python:
2-
- 2.7 # [linux64]
32
- 3.5 # [not win]
43
- 3.6
54
- 3.7
65
- 3.8
6+
- 3.9
77

88

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@
8484
classifiers=[
8585
'Intended Audience :: Science/Research',
8686
'Intended Audience :: Education',
87-
'Programming Language :: Python :: 2.7',
8887
'Programming Language :: Python :: 3.5',
8988
'Programming Language :: Python :: 3.6',
9089
'Programming Language :: Python :: 3.7',
9190
'Programming Language :: Python :: 3.8',
91+
'Programming Language :: Python :: 3.9',
9292
'Programming Language :: Python :: Implementation :: CPython',
9393
'Programming Language :: Python :: Implementation :: PyPy',
9494
# 'Programming Language :: SQL', -- not yet!

tests/validate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1303,7 +1303,7 @@ def run_tests(fns):
13031303
os.chdir(original_working_dir)
13041304
pickle_fn = fn + '.pickle'
13051305
with open(pickle_fn, 'wb') as com_output_file:
1306-
pickle.dump(output, com_output_file, protocol=pickle.HIGHEST_PROTOCOL)
1306+
pickle.dump(output, com_output_file, protocol=4)
13071307
print('COM output pickled to', pickle_fn)
13081308

13091309
output = type(output)()

0 commit comments

Comments
 (0)