Skip to content

Commit

Permalink
Bump to 0.6.2
Browse files Browse the repository at this point in the history
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
  • Loading branch information
MilesCranmer committed Dec 30, 2023
1 parent 69b734f commit 18589bb
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 32 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ jobs:
architecture: [x64, x86]
python-version:
- '3.9'
- '3.10'
- '3.12'
julia-version:
- '1.4'
- '1.6'
- '1.7'
- '1.8'
- '1.9'
- '1'
exclude:
- os: ubuntu-latest
architecture: x86
Expand Down Expand Up @@ -59,9 +58,9 @@ jobs:
jl${{ matrix.julia-version }}
${{ matrix.os }} ${{ matrix.architecture }}
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
Expand Down Expand Up @@ -99,9 +98,9 @@ jobs:
fail-fast: false
name: Check ${{ matrix.toxenv }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: '3.10'
- run: python -m pip install --upgrade tox
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install setuptools and wheel
Expand All @@ -39,9 +39,9 @@ jobs:
needs: publish-to-testpypi
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Set up Julia
Expand All @@ -57,10 +57,10 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix: # using `matrix` to define a constant
package: ['julia==0.6.1']
package: ['julia==0.6.2']
steps:
- name: Set up Python 3.9
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Download from TestPyPI
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/testtests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
test__using_default_setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
- run: python -m pip install --upgrade tox
- run: python -m tox -- --no-julia -k test__using_default_setup
env:
Expand Down
2 changes: 1 addition & 1 deletion ci/test-upload/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ deps =

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

python -c "from julia import install; install()"
python -m julia.runtests -- \
Expand Down
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
author = 'The Julia and IPython development teams'

# The short X.Y version
version = '0.6.1'
version = '0.6.2'
# The full version, including alpha/beta/rc tags
release = '0.6.1'
release = '0.6.2'


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ def pyload(path):
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
],
url='http://julialang.org',
project_urls={
Expand Down
32 changes: 19 additions & 13 deletions src/julia/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import textwrap
import warnings
from ctypes import c_char_p, c_void_p
from importlib.abc import Loader, MetaPathFinder
from importlib.machinery import ModuleSpec
from logging import getLogger # see `.logger`
from types import ModuleType # this is python 3.3 specific

Expand Down Expand Up @@ -189,7 +191,7 @@ def __try_getattr(self, name):
if self._julia.isamodule(jl_fullname):
realname = self._julia.fullname(self._julia.eval(jl_fullname))
if self._julia.isdefined(realname):
return self.__loader__.load_module("julia." + realname)
return self.__loader__.create_module(_find_spec_from_fullname("julia." + realname))
# Otherwise, it may be, e.g., "Main.anonymous", created by
# Module().

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


# add custom import behavior for the julia "module"
class JuliaImporter(object):
class JuliaImporter(MetaPathFinder):

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


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

class JuliaModuleLoader(Loader):
@property
def julia(self):
self.__class__.julia = julia = Julia()
return julia

# load module was deprecated in v3.4
def load_module(self, fullname):
def exec_module(self, module):
pass

def create_module(self, spec):
fullname = spec.name
juliapath = remove_prefix(fullname, "julia.")
if juliapath == 'Main':
return sys.modules.setdefault(fullname,
Expand Down
2 changes: 1 addition & 1 deletion src/julia/release.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is executed via setup.py and imported via __init__.py

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

0 comments on commit 18589bb

Please sign in to comment.