Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Upgrade to elixir 1.15 #67

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ jobs:
strategy:
matrix:
os: ['ubuntu-22.04']
elixir-version: ['1.14']
elixir-version: ['1.15.7']
otp-version: ['26']
python-version: ['3.8', '3.12']
python-version: ['3.12']
steps:
- name: Checkout IElixir project
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set version
if: inputs.is_release == 'true'
run: |
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/docker_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ on:
version:
required: true
type: string
build_docker_version:
required: true
type: string
is_release:
required: true
type: string
secrets:
DOCKERHUB_USERNAME:
required: true
Expand All @@ -18,7 +24,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout IElixir project
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
steps:
- name: Checkout IElixir project
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set version
if: inputs.is_release == 'true'
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/elixir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
needs: [generate_version, build_ielixir]
with:
version: ${{ needs.generate_version.outputs.version }}
build_docker_version: ${{ needs.generate_version.outputs.build_docker_version }}
is_release: ${{ needs.generate_version.outputs.is_release }}
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/generate_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
build_version:
description: "Generated build version"
value: ${{ jobs.generate_version.outputs.build_version }}
build_docker_version:
description: "Generated build docker version"
value: ${{ jobs.generate_version.outputs.build_docker_version }}
is_release:
description: "Generated is release flag"
value: ${{ jobs.generate_version.outputs.is_release }}
Expand All @@ -20,15 +23,17 @@ jobs:
outputs:
version: ${{ steps.gen_ielixir_version.outputs.IELIXIR_VERSION }}
build_version: ${{ steps.gen_ielixir_version.outputs.IELIXIR_BUILD_VERSION }}
build_docker_version: ${{ steps.gen_ielixir_version.outputs.IELIXIR_BUILD_DOCKER_VERSION }}
is_release: ${{ steps.gen_ielixir_version.outputs.IELIXIR_IS_RELEASE }}
steps:
- name: Checkout IElixir project
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Generate version
id: gen_ielixir_version
run: |
echo "IELIXIR_VERSION=$(cat ./VERSION)" >> $GITHUB_OUTPUT
echo "IELIXIR_BUILD_VERSION=$(cat ./VERSION)+dev$(date '+%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT
echo "IELIXIR_BUILD_DOCKER_VERSION=$(cat ./VERSION).$(date '+%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT
- name: Check if release
id: check_if_release
run: |
Expand Down
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
IElixir
=======

Jupyter's kernel for Elixir
Jupyter's kernel for Elixir.

[![Build Status](https://travis-ci.org/pprzetacznik/IElixir.svg?branch=master)](https://travis-ci.org/pprzetacznik/IElixir)
[![IElixir CI](https://github.com/pprzetacznik/IElixir/workflows/IElixir%20CI/badge.svg)](https://github.com/pprzetacznik/IElixir/actions?query=workflow%3A"IElixir+CI")
[![IElixir Docker](https://github.com/pprzetacznik/IElixir/workflows/IElixir%20Docker/badge.svg)](https://github.com/pprzetacznik/IElixir/actions?query=workflow%3A"IElixir+Docker")
[![Inline docs](http://inch-ci.org/github/pprzetacznik/IElixir.svg?branch=master)](http://inch-ci.org/github/pprzetacznik/IElixir)
[![Coverage Status](https://coveralls.io/repos/github/pprzetacznik/IElixir/badge.svg?branch=master)](https://coveralls.io/github/pprzetacznik/IElixir?branch=master)
[![Join the chat at https://gitter.im/pprzetacznik/IElixir](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/pprzetacznik/IElixir?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Hex: https://hex.pm/packages/ielixir.

Please see generated documentation for implementation details: http://hexdocs.pm/ielixir/.
Docker: [pprzetacznik/ielixir](https://hub.docker.com/r/pprzetacznik/ielixir).

## Getting Started

Expand All @@ -27,6 +26,7 @@ Please see generated documentation for implementation details: http://hexdocs.pm
* [Generate documentation](#generate-documentation)
* [Docker](#docker)
* [Some issues](#some-issues)
* [Publish new release](#publish-new-release)
* [Contribution](#contribution)
* [References](#references)
* [License](#license)
Expand Down Expand Up @@ -223,6 +223,13 @@ This option has been included inside `install_script.sh` and `start_script.sh` s
$ jupyter kernelspec list
```

### Publish new release

```Bash
$ git tag v1.0.1
$ git push origin v1.0.1
```

### Contribution

* Try to write some description of the feature or bug fix you're working in pull request's description and concise description of new modules or functions in moduledoc annotations,
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.1
1.0.2
2 changes: 1 addition & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :logger,
level: :info
Expand Down
5 changes: 2 additions & 3 deletions config/dev.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :logger,
level: :debug
Expand All @@ -8,6 +8,5 @@ config :ielixir,
working_directory: System.get_env("WORKING_DIRECTORY")

config :ielixir, IElixir.Repo,
adapter: Sqlite.Ecto,
adapter: Ecto.Adapters.SQLite3,
database: "dev_db.sqlite3"

2 changes: 1 addition & 1 deletion config/docs.exs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is responsible for configuring your application
# and its dependencies with the aid of the Mix.Config module.
use Mix.Config
import Config

# This configuration is loaded before any dependency and is restricted
# to this project. If another project depends on this project, this
Expand Down
4 changes: 2 additions & 2 deletions config/prod.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :logger,
level: :info
Expand All @@ -8,5 +8,5 @@ config :ielixir,
working_directory: System.get_env("WORKING_DIRECTORY")

config :ielixir, IElixir.Repo,
adapter: Sqlite.Ecto,
adapter: Ecto.Adapters.SQLite3,
database: "prod_db.sqlite3"
5 changes: 2 additions & 3 deletions config/test.exs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
use Mix.Config
import Config

config :logger,
level: :debug

config :ielixir, connection_file: "test/test_connection_file"

config :ielixir, IElixir.Repo,
adapter: Sqlite.Ecto,
adapter: Ecto.Adapters.SQLite3,
database: "test_db.sqlite3"

23 changes: 12 additions & 11 deletions lib/ielixir/boyle.ex
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ defmodule Boyle do
Code.load_file("mix.exs")
# Mix.Project.push(CustomEnvironment)
# IO.inspect(CustomEnvironment.project())

Mix.Task.run("deps.get")
Mix.Tasks.Deps.Compile.run([])
end)
Expand Down Expand Up @@ -338,22 +339,22 @@ defmodule Boyle do

defp create_mix_exs_file(env_path) do
File.write!(Path.join(env_path, "mix.exs"), """
defmodule CustomEnvironment do
use Mix.Project
defmodule CustomEnvironment do
use Mix.Project

def project do
def project do
[app: :customenv,
version: "1.0.0",
build_per_environment: false,
deps: deps()]
end

def deps do
{deps, _bindings} = Code.eval_file("deps.lock")
deps
end
end
""")
end

def deps do
{deps, _bindings} = Code.eval_file("deps.lock")
deps
end
end
""")
end

defp create_deps_lock_file(env_path) do
Expand Down
4 changes: 3 additions & 1 deletion lib/ielixir/repo.ex
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
defmodule IElixir.Repo do
use Ecto.Repo,
otp_app: :ielixir,
adapter: Sqlite.Ecto2
adapter: Ecto.Adapters.SQLite3,
# locking_mode: :exclusive,
pool_size: 1
end
2 changes: 1 addition & 1 deletion lib/ielixir/sandbox.ex
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ defmodule IElixir.Sandbox do

iex> IElixir.Sandbox.execute_code(%{"code" => "hd []"})
{:error, "ArgumentError", ["** (ArgumentError) \"errors were found at the given arguments:\\n\\n * 1st argument: not a nonempty list\\n\""], 1}

iex> abc = IElixir.Sandbox.execute_code(%{"code" => "\"a\" + 5"})
iex> elem(abc, 0)
:error
Expand Down
4 changes: 2 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ defmodule IElixir.Mixfile do
def application do
[
mod: {IElixir, []},
applications: [:logger, :iex, :ecto, :erlzmq, :poison, :uuid, :floki]
applications: [:logger, :iex, :ecto_sqlite3, :erlzmq, :poison, :uuid, :floki]
]
end

Expand All @@ -39,7 +39,7 @@ defmodule IElixir.Mixfile do
{:floki, "~> 0.29.0"},
{:poison, "~> 3.0"},
{:uuid, "~> 1.7.5", [hex: "uuid_erl", repo: "hexpm"]},
{:sqlite_ecto2, "~> 2.4.0"},
{:ecto_sqlite3, "~> 0.14"},

# Docs dependencies
{:earmark, "~> 1.3.6", only: :docs},
Expand Down
Loading
Loading