Skip to content

Commit

Permalink
RPN now works on Python 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
ConceptJunkie committed Nov 20, 2021
1 parent 57e8d28 commit 11bfe97
Show file tree
Hide file tree
Showing 12 changed files with 778 additions and 31 deletions.
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@ rpnChilada supports arithmetic with arbitrary precision, powers and roots, logar

## Updates

### Update - November 19, 2021

Python 3.10 really broke RPN, but the fixes were simple.

8.5.5 includes several small fixes to deal with incompatibilities introduced with Python 3.10, the most significant of which is that pyreadline, the moribund library that provides readline functionality for Python on Windows was replaced with pyreadline3, which is apparently still maintained.

### Update - September 27, 2021

RPN isn't dead, although I figured it was time for a new release since with the
library updates, 8.4.0 didn't work any more.

rpn 8.5.2 is released: Big Clean-Up and Documentation Release!
rpn 8.5.4 is released: Big Clean-Up and Documentation Release!

Much more thorough argument validation has been implemented on all operators.
In addition, all non-constant operator function names now end with 'Operator',
Expand All @@ -29,7 +35,7 @@ About 70 new operators have been added.

---

The current release is 8.5.2.
The current release is 8.5.5.

See "rpn help settings" for more information.

Expand All @@ -39,6 +45,9 @@ In theory, you just need to do "pip install rpnChilada".

Windows users will want to use Christophe Gohlke's Windows installers for gmpy2 and pyephem at https://www.lfd.uci.edu/~gohlke/pythonlibs/.

For Python 3.10, an installer for gmpy2 can be found here:
https://github.com/aleaxit/gmpy/releases/download/gmpy2-2.1.0rc1/gmpy2-2.1.0rc1-cp310-cp310-win_amd64.whl

## Installing RPN on Debian-based Linux:

I don't think this is correct yet.
Expand Down Expand Up @@ -101,7 +110,7 @@ p.s. rpn is licensed under the GNU GPL version 3.0. See (see (http://www.gnu.org

## Release Notes

8.5.2
8.5.4

Big Clean-Up and Documentation Release!

Expand Down
17 changes: 9 additions & 8 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
arrow>=1.1.1
arrow>=1.2.1
convertdate>=2.3.2
python-dateutil>=2.8.1
ephem>=4.0.0.2
python-dateutil>=2.8.2
ephem>=4.1
ethiopian-date-converter>=0.1.5
geopy>=2.2.0
gmpy2>=2.0.8
hyperop>=1.1
importlib_resources>=5.2.2
importlib_resources>=5.4.0
mpmath>=1.2.1
numpy>=1.21.2
pytz>=2021.1
numpy>=1.19.5
pyreadline3>=3.3
pytz>=2021.3
rpnChiladaData>=1.1.0
setuptools>=56.1.0
skyfield>=1.39
skyfield>=1.40
timezonefinder>=5.2.0
tzlocal>=3.0
tzlocal>=4.1
wheel>=0.37.0
20 changes: 20 additions & 0 deletions rpn/makeHelp.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,11 @@ def makeCommandExample( command, indent=0, slow=False ):

'reversal_addition' doesn't work with generators. I see a theme here.

'hyperop' just doesn't work very well. It gives incorrect answers in some
instances and overflows when analogous operations with the 'tetrate' operator
work fine. Since I'm using a library, I think I should just replace it with my
own code.

See 'rpn help TODO'.
''',
'TODO' :
Expand Down Expand Up @@ -1361,6 +1366,21 @@ def makeCommandExample( command, indent=0, slow=False ):
8.5.2

The library name is now "python-dateutil", not "dateutil".

8.5.3

Still sorting out the requirements that allow updates.

8.5.4

Got rid of a unit test that fails on Android and Linux, at least until I can
figure out why.

8.5.5

Python 3.10 broke some stuff, including the pyreadline modules. I replaced that
with pyreadline3, which works fine and is actually being maintained. I also
fixed a few other incompatibilities introduced by Python 3.10.
''',
'license' :
'''
Expand Down
7 changes: 4 additions & 3 deletions rpn/rpn.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@

import argparse
import os
import readline
import sys
import time

from pathlib import Path
from pyreadline3.rlmain import Readline as readline

from mpmath import fneg, im, mp, mpc, mpmathify, nan, nstr, re

Expand Down Expand Up @@ -273,8 +273,9 @@ def enterInteractiveMode( ):
mode, where it will continue to evaluate new expressions input until
the 'exit' command.
'''
readline.parse_and_bind( 'tab: complete' )
readline.parse_and_bind( 'set editing-mode vi' )
rl = readline( )
rl.parse_and_bind( 'tab: complete' )
rl.parse_and_bind( 'set editing-mode vi' )

printTitleScreen( PROGRAM_NAME, PROGRAM_DESCRIPTION )

Expand Down
Loading

0 comments on commit 11bfe97

Please sign in to comment.