Skip to content

Commit de79d3a

Browse files
committed
Bump to 0.6.2
Squashed commit of the following: commit 18589bb Author: MilesCranmer <[email protected]> Date: Sat Dec 30 02:25:30 2023 +0000 Bump to 0.6.2 Squashed commit of the following: commit 12cba08 Merge: 28af425 ce3ac83 Author: Miles Cranmer <[email protected]> Date: Sat Dec 30 02:23:21 2023 +0000 Merge pull request #544 from JuliaPy/update-to-0.6.2 Bump to 0.6.2 with Python 3.12 fix commit ce3ac83 Author: MilesCranmer <[email protected]> Date: Sat Dec 30 02:03:45 2023 +0000 Bump to 0.6.2 with Python 3.12 fix commit 28af425 Author: Miles Cranmer <[email protected]> Date: Fri Dec 29 16:55:50 2023 +0000 Update setup actions and get working on 3.12 (#541) * Update setup actions * Fix PyJulia on Python 3.12 (#538) * Fix importlib deprecated API * Test Python 3.12 * Test Julia 1.9 * Fix semantics of exec_module vs create_module * Ensure we can find spec from JuliaModule * Bump version with python 3.12 compat * Declare compat for 3.11 and 3.12 * Only test 1.6, 1.9, 1
1 parent 472b4df commit de79d3a

File tree

8 files changed

+39
-32
lines changed

8 files changed

+39
-32
lines changed

.github/workflows/main.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@ jobs:
2020
architecture: [x64, x86]
2121
python-version:
2222
- '3.9'
23-
- '3.10'
23+
- '3.12'
2424
julia-version:
25-
- '1.4'
2625
- '1.6'
27-
- '1.7'
28-
- '1.8'
26+
- '1.9'
27+
- '1'
2928
exclude:
3029
- os: ubuntu-latest
3130
architecture: x86
@@ -59,9 +58,9 @@ jobs:
5958
jl${{ matrix.julia-version }}
6059
${{ matrix.os }} ${{ matrix.architecture }}
6160
steps:
62-
- uses: actions/checkout@v1
61+
- uses: actions/checkout@v4
6362
- name: Setup python
64-
uses: actions/setup-python@v1
63+
uses: actions/setup-python@v4
6564
with:
6665
python-version: ${{ matrix.python-version }}
6766
architecture: ${{ matrix.architecture }}
@@ -99,9 +98,9 @@ jobs:
9998
fail-fast: false
10099
name: Check ${{ matrix.toxenv }}
101100
steps:
102-
- uses: actions/checkout@v2
101+
- uses: actions/checkout@v4
103102
- name: Setup python
104-
uses: actions/setup-python@v1
103+
uses: actions/setup-python@v4
105104
with:
106105
python-version: '3.10'
107106
- run: python -m pip install --upgrade tox

.github/workflows/publish.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v2
1616
- name: Set up Python 3.9
17-
uses: actions/setup-python@v1
17+
uses: actions/setup-python@v4
1818
with:
1919
python-version: 3.9
2020
- name: Install setuptools and wheel
@@ -39,9 +39,9 @@ jobs:
3939
needs: publish-to-testpypi
4040
runs-on: ubuntu-20.04
4141
steps:
42-
- uses: actions/checkout@v2
42+
- uses: actions/checkout@v4
4343
- name: Set up Python 3.9
44-
uses: actions/setup-python@v1
44+
uses: actions/setup-python@v4
4545
with:
4646
python-version: 3.9
4747
- name: Set up Julia
@@ -57,10 +57,10 @@ jobs:
5757
runs-on: ubuntu-20.04
5858
strategy:
5959
matrix: # using `matrix` to define a constant
60-
package: ['julia==0.6.1']
60+
package: ['julia==0.6.2']
6161
steps:
6262
- name: Set up Python 3.9
63-
uses: actions/setup-python@v1
63+
uses: actions/setup-python@v4
6464
with:
6565
python-version: 3.9
6666
- name: Download from TestPyPI

.github/workflows/testtests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212
test__using_default_setup:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v4
1616
- name: Setup python
17-
uses: actions/setup-python@v1
17+
uses: actions/setup-python@v4
1818
- run: python -m pip install --upgrade tox
1919
- run: python -m tox -- --no-julia -k test__using_default_setup
2020
env:

ci/test-upload/tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ deps =
1616

1717
commands =
1818
shell-retry --backoff=2 --interval-max=20 --retry-count=30 --verbose -- \
19-
pip install --index-url https://test.pypi.org/simple/ julia==0.6.1
19+
pip install --index-url https://test.pypi.org/simple/ julia==0.6.2
2020

2121
python -c "from julia import install; install()"
2222
python -m julia.runtests -- \

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
author = 'The Julia and IPython development teams'
2626

2727
# The short X.Y version
28-
version = '0.6.1'
28+
version = '0.6.2'
2929
# The full version, including alpha/beta/rc tags
30-
release = '0.6.1'
30+
release = '0.6.2'
3131

3232

3333
# -- General configuration ---------------------------------------------------

setup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ def pyload(path):
6767
'Programming Language :: Python :: 3.8',
6868
'Programming Language :: Python :: 3.9',
6969
'Programming Language :: Python :: 3.10',
70+
'Programming Language :: Python :: 3.11',
71+
'Programming Language :: Python :: 3.12',
7072
],
7173
url='http://julialang.org',
7274
project_urls={

src/julia/core.py

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
import textwrap
2525
import warnings
2626
from ctypes import c_char_p, c_void_p
27+
from importlib.abc import Loader, MetaPathFinder
28+
from importlib.machinery import ModuleSpec
2729
from logging import getLogger # see `.logger`
2830
from types import ModuleType # this is python 3.3 specific
2931

@@ -189,7 +191,7 @@ def __try_getattr(self, name):
189191
if self._julia.isamodule(jl_fullname):
190192
realname = self._julia.fullname(self._julia.eval(jl_fullname))
191193
if self._julia.isdefined(realname):
192-
return self.__loader__.load_module("julia." + realname)
194+
return self.__loader__.create_module(_find_spec_from_fullname("julia." + realname))
193195
# Otherwise, it may be, e.g., "Main.anonymous", created by
194196
# Module().
195197

@@ -220,27 +222,31 @@ def __setattr__(self, name, value):
220222

221223

222224
# add custom import behavior for the julia "module"
223-
class JuliaImporter(object):
225+
class JuliaImporter(MetaPathFinder):
224226

225-
# find_module was deprecated in v3.4
226-
def find_module(self, fullname, path=None):
227-
if fullname.startswith("julia."):
228-
filename = fullname.split(".", 2)[1]
229-
filepath = os.path.join(os.path.dirname(__file__), filename)
230-
if os.path.isfile(filepath + ".py") or os.path.isdir(filepath):
231-
return
232-
return JuliaModuleLoader()
227+
def find_spec(self, fullname, path=None, target=None):
228+
return _find_spec_from_fullname(fullname)
233229

234230

235-
class JuliaModuleLoader(object):
231+
def _find_spec_from_fullname(fullname):
232+
if fullname.startswith("julia."):
233+
filename = fullname.split(".", 2)[1]
234+
filepath = os.path.join(os.path.dirname(__file__), filename)
235+
if os.path.isfile(filepath + ".py") or os.path.isdir(filepath):
236+
return
237+
return ModuleSpec(fullname, JuliaModuleLoader(), origin=filepath)
236238

239+
class JuliaModuleLoader(Loader):
237240
@property
238241
def julia(self):
239242
self.__class__.julia = julia = Julia()
240243
return julia
241244

242-
# load module was deprecated in v3.4
243-
def load_module(self, fullname):
245+
def exec_module(self, module):
246+
pass
247+
248+
def create_module(self, spec):
249+
fullname = spec.name
244250
juliapath = remove_prefix(fullname, "julia.")
245251
if juliapath == 'Main':
246252
return sys.modules.setdefault(fullname,

src/julia/release.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This file is executed via setup.py and imported via __init__.py
22

3-
__version__ = "0.6.1"
3+
__version__ = "0.6.2"
44
# For Python versioning scheme, see:
55
# https://www.python.org/dev/peps/pep-0440/#version-scheme

0 commit comments

Comments
 (0)