Name | juliapkg JSON |
Version |
0.1.15
JSON |
| download |
home_page | None |
Summary | Julia version manager and package manager |
upload_time | 2024-11-08 16:40:41 |
maintainer | None |
docs_url | None |
author | Christopher Doris |
requires_python | >=3.8 |
license | None |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# JuliaPkg
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![Tests](https://github.com/JuliaPy/pyjuliapkg/actions/workflows/tests.yml/badge.svg)](https://github.com/JuliaPy/pyjuliapkg/actions/workflows/tests.yml)
[![Codecov](https://codecov.io/gh/JuliaPy/pyjuliapkg/branch/main/graph/badge.svg?token=A813UUIHGS)](https://codecov.io/gh/JuliaPy/pyjuliapkg)
Do you want to use [Julia](https://julialang.org/) in your Python script/project/package?
No problem! JuliaPkg will help you out!
- Declare the version of Julia you require in a `juliapkg.json` file.
- Add any packages you need too.
- Call `juliapkg.resolve()` et voila, your dependencies are there.
- Use `juliapkg.executable()` to find the Julia executable and `juliapkg.project()` to
find the project where the packages were installed.
- Virtual environments? PipEnv? Poetry? Conda? No problem! JuliaPkg will set up a
different project for each environment you work in, keeping your dependencies isolated.
## Install
```sh
pip install juliapkg
```
## Declare dependencies
### Functional interface
- `status(target=None)` shows the status of dependencies.
- `require_julia(version, target=None)` declares that you require the given version of
Julia. The `version` is a Julia compat specifier, so `1.5` matches any `1.*.*` version at
least `1.5`.
- `add(pkg, uuid, dev=False, version=None, path=None, subdir=None, url=None, rev=None, target=None)`
adds a required package. Its name and UUID are required.
- `rm(pkg, target=None)` remove a package.
Note that these functions edit `juliapkg.json` but do not actually install anything until
`resolve()` is called, which happens automatically in `executable()` and `project()`.
The `target` specifies the `juliapkg.json` file to edit, or the directory containing it.
If not given, it will be your virtual environment or Conda environment if you are using one,
otherwise `~/.pyjuliapkg.json`.
### juliapkg.json
You can also edit `juliapkg.json` directly if you like. Here is an example which requires
Julia v1.*.* and the Example package v0.5.*:
```json
{
"julia": "1",
"packages": {
"Example": {
"uuid": "7876af07-990d-54b4-ab0e-23690620f79a",
"version": "0.5"
}
}
}
```
## Using Julia
- `juliapkg.executable()` returns a compatible Julia executable.
- `juliapkg.project()` returns the project into which the packages have been installed.
- `juliapkg.resolve(force=False)` ensures all the dependencies are installed. You don't
normally need to do this because the other functions resolve automatically.
## Details
### Configuration
JuliaPkg does not generally need configuring, but for advanced usage the following options
are available. Options can be specified either as an environment variable or as an `-X`
option to `python`. The `-X` option has higher precedence.
| Environment Variable | `-X` Option | Description |
| --- | --- | --- |
| `PYTHON_JULIAPKG_EXE=<exe>` | `-X juliapkg-exe=<exe>` | The Julia executable to use. |
| `PYTHON_JULIAPKG_PROJECT=<project>` | `-X juliapkg-project=<project>` | The Julia project where packages are installed. |
| `PYTHON_JULIAPKG_OFFLINE=<yes/no>` | `-X juliapkg-offline=<yes/no>` | Work in Offline Mode - does not install Julia or any packages. |
### Which Julia gets used?
JuliaPkg tries the following strategies in order to find Julia on your system:
- If the `-X juliapkg-exe` argument to `python` is set, that is used.
- If the environment variable `PYTHON_JULIAPKG_EXE` is set, that is used.
- If `julia` is in your `PATH`, and is compatible, that is used.
- If [`juliaup`](https://github.com/JuliaLang/juliaup) is in your `PATH`, it is used to install a compatible version of Julia.
- Otherwise, JuliaPkg downloads a compatible version of Julia and installs it into the
Julia project.
More strategies may be added in a future release.
### Where are Julia packages installed?
JuliaPkg installs packages into a project whose location is determined by trying the
following strategies in order:
- If the `-X juliapkg-project` argument to `python` is set, that is used.
- If the environment variable `PYTHON_JULIAPKG_PROJECT` is set, that is used.
- If you are in a Python virtual environment or Conda environment, then `{env}/julia_env`
subdirectory is used.
- Otherwise `~/.julia/environments/pyjuliapkg` is used (respects `JULIA_DEPOT`).
More strategies may be added in a future release.
### Adding Julia dependencies to Python packages
JuliaPkg looks for `juliapkg.json` files in many locations, namely:
- `{project}/pyjuliapkg` where project is as above (depending on your environment).
- Every directory and direct sub-directory in `sys.path`.
The last point means that if you put a `juliapkg.json` file in a package, then install that
package, then JuliaPkg will find those dependencies and install them.
You can use `add`, `rm` etc. above with `target='/path/to/your/package'` to modify the
dependencies of your package.
### Offline mode
If you set the environment variable `PYTHON_JULIAPKG_OFFLINE=yes` (or call `python` with the
option `-X juliapkg-offline=yes`) then JuliaPkg will operate in offline mode. This means it
will not attempt to download Julia or any packages.
Resolving will fail if Julia is not already installed. It is up to you to install any
required Julia packages.
Raw data
{
"_id": null,
"home_page": null,
"name": "juliapkg",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": null,
"author": "Christopher Doris",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/8e/15/f3a172409d41cdf1a8c4289cfaab3fadfcce21fbe53d9730b5c7754da4b9/juliapkg-0.1.15.tar.gz",
"platform": null,
"description": "# JuliaPkg\n\n[![Project Status: Active \u2013 The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)\n[![Tests](https://github.com/JuliaPy/pyjuliapkg/actions/workflows/tests.yml/badge.svg)](https://github.com/JuliaPy/pyjuliapkg/actions/workflows/tests.yml)\n[![Codecov](https://codecov.io/gh/JuliaPy/pyjuliapkg/branch/main/graph/badge.svg?token=A813UUIHGS)](https://codecov.io/gh/JuliaPy/pyjuliapkg)\n\nDo you want to use [Julia](https://julialang.org/) in your Python script/project/package?\nNo problem! JuliaPkg will help you out!\n- Declare the version of Julia you require in a `juliapkg.json` file.\n- Add any packages you need too.\n- Call `juliapkg.resolve()` et voila, your dependencies are there.\n- Use `juliapkg.executable()` to find the Julia executable and `juliapkg.project()` to\n find the project where the packages were installed.\n- Virtual environments? PipEnv? Poetry? Conda? No problem! JuliaPkg will set up a\n different project for each environment you work in, keeping your dependencies isolated.\n\n## Install\n\n```sh\npip install juliapkg\n```\n\n## Declare dependencies\n\n### Functional interface\n\n- `status(target=None)` shows the status of dependencies.\n- `require_julia(version, target=None)` declares that you require the given version of\n Julia. The `version` is a Julia compat specifier, so `1.5` matches any `1.*.*` version at\n least `1.5`.\n- `add(pkg, uuid, dev=False, version=None, path=None, subdir=None, url=None, rev=None, target=None)`\n adds a required package. Its name and UUID are required.\n- `rm(pkg, target=None)` remove a package.\n\nNote that these functions edit `juliapkg.json` but do not actually install anything until\n`resolve()` is called, which happens automatically in `executable()` and `project()`.\n\nThe `target` specifies the `juliapkg.json` file to edit, or the directory containing it.\nIf not given, it will be your virtual environment or Conda environment if you are using one,\notherwise `~/.pyjuliapkg.json`.\n\n### juliapkg.json\n\nYou can also edit `juliapkg.json` directly if you like. Here is an example which requires\nJulia v1.*.* and the Example package v0.5.*:\n```json\n{\n \"julia\": \"1\",\n \"packages\": {\n \"Example\": {\n \"uuid\": \"7876af07-990d-54b4-ab0e-23690620f79a\",\n \"version\": \"0.5\"\n }\n }\n}\n```\n\n## Using Julia\n\n- `juliapkg.executable()` returns a compatible Julia executable.\n- `juliapkg.project()` returns the project into which the packages have been installed.\n- `juliapkg.resolve(force=False)` ensures all the dependencies are installed. You don't\n normally need to do this because the other functions resolve automatically.\n\n## Details\n\n### Configuration\n\nJuliaPkg does not generally need configuring, but for advanced usage the following options\nare available. Options can be specified either as an environment variable or as an `-X`\noption to `python`. The `-X` option has higher precedence.\n\n| Environment Variable | `-X` Option | Description |\n| --- | --- | --- |\n| `PYTHON_JULIAPKG_EXE=<exe>` | `-X juliapkg-exe=<exe>` | The Julia executable to use. |\n| `PYTHON_JULIAPKG_PROJECT=<project>` | `-X juliapkg-project=<project>` | The Julia project where packages are installed. |\n| `PYTHON_JULIAPKG_OFFLINE=<yes/no>` | `-X juliapkg-offline=<yes/no>` | Work in Offline Mode - does not install Julia or any packages. |\n\n### Which Julia gets used?\n\nJuliaPkg tries the following strategies in order to find Julia on your system:\n- If the `-X juliapkg-exe` argument to `python` is set, that is used.\n- If the environment variable `PYTHON_JULIAPKG_EXE` is set, that is used.\n- If `julia` is in your `PATH`, and is compatible, that is used.\n- If [`juliaup`](https://github.com/JuliaLang/juliaup) is in your `PATH`, it is used to install a compatible version of Julia.\n- Otherwise, JuliaPkg downloads a compatible version of Julia and installs it into the\n Julia project.\n\nMore strategies may be added in a future release.\n\n### Where are Julia packages installed?\n\nJuliaPkg installs packages into a project whose location is determined by trying the\nfollowing strategies in order:\n- If the `-X juliapkg-project` argument to `python` is set, that is used.\n- If the environment variable `PYTHON_JULIAPKG_PROJECT` is set, that is used.\n- If you are in a Python virtual environment or Conda environment, then `{env}/julia_env`\n subdirectory is used.\n- Otherwise `~/.julia/environments/pyjuliapkg` is used (respects `JULIA_DEPOT`).\n\nMore strategies may be added in a future release.\n\n### Adding Julia dependencies to Python packages\n\nJuliaPkg looks for `juliapkg.json` files in many locations, namely:\n- `{project}/pyjuliapkg` where project is as above (depending on your environment).\n- Every directory and direct sub-directory in `sys.path`.\n\nThe last point means that if you put a `juliapkg.json` file in a package, then install that\npackage, then JuliaPkg will find those dependencies and install them.\n\nYou can use `add`, `rm` etc. above with `target='/path/to/your/package'` to modify the\ndependencies of your package.\n\n### Offline mode\n\nIf you set the environment variable `PYTHON_JULIAPKG_OFFLINE=yes` (or call `python` with the\noption `-X juliapkg-offline=yes`) then JuliaPkg will operate in offline mode. This means it\nwill not attempt to download Julia or any packages.\n\nResolving will fail if Julia is not already installed. It is up to you to install any\nrequired Julia packages.\n",
"bugtrack_url": null,
"license": null,
"summary": "Julia version manager and package manager",
"version": "0.1.15",
"project_urls": {
"Changelog": "https://github.com/JuliaPy/pyjuliapkg/blob/main/CHANGELOG.md",
"Homepage": "http://github.com/JuliaPy/pyjuliapkg",
"Issues": "http://github.com/JuliaPy/pyjuliapkg/issues",
"Repository": "http://github.com/JuliaPy/pyjuliapkg.git"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "a18705a0d9acd2172516480e384bd66f269e97c61b7b5412deaceca0db3e43be",
"md5": "2bee1da416b047c5c42d01ab11532938",
"sha256": "47b3ebb5bc200b31252e3be0e740a37925ff472919cac84f32b7bd4afa3a1a53"
},
"downloads": -1,
"filename": "juliapkg-0.1.15-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2bee1da416b047c5c42d01ab11532938",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 16137,
"upload_time": "2024-11-08T16:40:40",
"upload_time_iso_8601": "2024-11-08T16:40:40.305525Z",
"url": "https://files.pythonhosted.org/packages/a1/87/05a0d9acd2172516480e384bd66f269e97c61b7b5412deaceca0db3e43be/juliapkg-0.1.15-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "8e15f3a172409d41cdf1a8c4289cfaab3fadfcce21fbe53d9730b5c7754da4b9",
"md5": "ccc2a849b9f604dffa0c4b5624b74c36",
"sha256": "a36096fed2ddfe6fbd1af9bfd1b182136d84a660d0c4187539194229fb383720"
},
"downloads": -1,
"filename": "juliapkg-0.1.15.tar.gz",
"has_sig": false,
"md5_digest": "ccc2a849b9f604dffa0c4b5624b74c36",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 16065,
"upload_time": "2024-11-08T16:40:41",
"upload_time_iso_8601": "2024-11-08T16:40:41.407586Z",
"url": "https://files.pythonhosted.org/packages/8e/15/f3a172409d41cdf1a8c4289cfaab3fadfcce21fbe53d9730b5c7754da4b9/juliapkg-0.1.15.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-08 16:40:41",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "JuliaPy",
"github_project": "pyjuliapkg",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "juliapkg"
}