-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
796 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "weekly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: ['*'] | ||
pull_request: | ||
workflow_dispatch: | ||
concurrency: | ||
# Skip intermediate builds: always. | ||
# Cancel intermediate builds: only if it is a pull request build. | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} | ||
jobs: | ||
test: | ||
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 60 | ||
permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created | ||
actions: write | ||
contents: read | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
version: | ||
- '1.10' | ||
- 'pre' | ||
os: | ||
- ubuntu-latest | ||
# - mac-os-latest | ||
- windows-latest | ||
arch: | ||
- x64 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: julia-actions/setup-julia@v2 | ||
with: | ||
version: ${{ matrix.version }} | ||
arch: ${{ matrix.arch }} | ||
- uses: julia-actions/cache@v2 | ||
- uses: julia-actions/julia-buildpkg@v1 | ||
- uses: julia-actions/julia-runtest@v1 | ||
- uses: julia-actions/julia-processcoverage@v1 | ||
- uses: codecov/codecov-action@v5 | ||
with: | ||
files: lcov.info | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
fail_ci_if_error: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: CompatHelper | ||
on: | ||
schedule: | ||
- cron: 0 0 * * * | ||
workflow_dispatch: | ||
jobs: | ||
CompatHelper: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Pkg.add("CompatHelper") | ||
run: julia -e 'using Pkg; Pkg.add("CompatHelper")' | ||
- name: CompatHelper.main() | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }} | ||
run: julia -e 'using CompatHelper; CompatHelper.main()' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: TagBot | ||
on: | ||
issue_comment: | ||
types: | ||
- created | ||
workflow_dispatch: | ||
inputs: | ||
lookback: | ||
default: "3" | ||
permissions: | ||
actions: read | ||
checks: read | ||
contents: write | ||
deployments: read | ||
issues: read | ||
discussions: read | ||
packages: read | ||
pages: read | ||
pull-requests: read | ||
repository-projects: read | ||
security-events: read | ||
statuses: read | ||
jobs: | ||
TagBot: | ||
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: JuliaRegistries/TagBot@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
ssh: ${{ secrets.DOCUMENTER_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
*.jl.*.cov | ||
*.jl.cov | ||
*.jl.mem | ||
/Manifest.toml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 John Lapeyre <jlapeyre@users.noreply.github.com> and contributors | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name = "StackEnvs" | ||
uuid = "6dbe6948-1a74-428b-a0c7-b6033448b207" | ||
authors = ["John Lapeyre <jlapeyre@users.noreply.github.com> and contributors"] | ||
version = "0.1.0" | ||
|
||
[deps] | ||
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" | ||
TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76" | ||
|
||
[compat] | ||
Aqua = ">= 0" | ||
TOML = "1.0.3" | ||
JET = ">= 0" | ||
Test = ">= 0" | ||
Pkg = ">= 0" | ||
julia = "1.8" | ||
|
||
[extras] | ||
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" | ||
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" | ||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | ||
|
||
[targets] | ||
test = ["Test", "Aqua", "JET"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# StackEnvs | ||
|
||
[![Build Status](https://github.com/jlapeyre/StackEnvs.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/jlapeyre/StackEnvs.jl/actions/workflows/CI.yml?query=branch%3Amain) | ||
[![Coverage](https://codecov.io/gh/jlapeyre/StackEnvs.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/jlapeyre/StackEnvs.jl) | ||
[![Aqua QA](https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg)](https://github.com/JuliaTesting/Aqua.jl) | ||
|
||
`StackEnvs` provides tools for minimal management of a shared environment that is meant to be used from your "stacked environment" but never to be active itself. | ||
|
||
This is useful if you are developing a package and want to use some other packages without polluting any environment. | ||
|
||
It is meant to be used in a script that you `include` when, for example, developing a particular package, and want some other particular | ||
packages to be available. | ||
|
||
```julia | ||
using StackEnvs | ||
env = StackEnv("my_env", ["PackA", "PackB"]) | ||
ensure_in_stack(env) | ||
``` | ||
|
||
or more simply, | ||
|
||
```julia | ||
using StackEnvs | ||
ensure_in_stack("my_env", ["PackA", "PackB"]) | ||
``` | ||
|
||
After including the script, you can immediately `using PackA`. | ||
|
||
> [!WARNING] | ||
> `StackedEnvs` pays no attention to version numbers, uuids. It can't remove any packages. It is useful | ||
for some simple, straightforward, use cases. | ||
|
||
> [!WARNING] | ||
> The test suite adds and deletes an environment to your `~/.julia/environments` directory. Something could potentially go wrong causing it | ||
to delete your entire home directory. I've taken some steps to minimize this risk. There is nothing like `rm -r *` in the test. Rather, the | ||
two `toml` files are deleted, then the empty directory is deleted. If any of this should fail, the test suite will fail. | ||
|
||
> [!WARNING] | ||
> `StackedEnvs` uses some non-API functions in `Base`. But the way these are used is simple and should be fixable. | ||
### Example | ||
|
||
```julia-repl | ||
julia> using StackEnvs | ||
julia> env = StackEnv("my_env", ["StatsBase"]) | ||
StackEnv("my_env", [:StatsBase]) | ||
julia> env_exists(env) | ||
false | ||
julia> is_in_stack(env) | ||
false | ||
julia> ensure_in_stack(env) | ||
Activating new project at `~/.julia/environments/my_env` | ||
Resolving package versions... | ||
julia> is_in_stack(env) | ||
true | ||
julia> env_exists(env) | ||
true | ||
julia> using StatsBase | ||
julia> push!(env, "ILog2") | ||
2-element Vector{Symbol}: | ||
:StatsBase | ||
:ILog2 | ||
julia> ensure_in_stack(env) | ||
Activating project at `~/.julia/environments/my_env` | ||
Resolving package versions... | ||
Updating `~/.julia/environments/my_env/Project.toml` | ||
[2cd5bd5f] + ILog2 v2.0.0 | ||
Updating `~/.julia/environments/my_env/Manifest.toml` | ||
[2cd5bd5f] + ILog2 v2.0.0 | ||
Activating project at `~/github/jlapeyre/StackEnvs` | ||
StackEnv("my_env", [:StatsBase, :ILog2]) | ||
julia> ensure_in_stack(env) # Nothing to do. Returns in 30 micro seconds | ||
StackEnv("my_env", [:StatsBase, :ILog2]) | ||
``` | ||
|
||
<!-- LocalWords: StackEnvs julia env StackEnv PackA StackedEnvs uuids toml repl ILog2 | ||
<!-- LocalWords: StatsBase 2cd5bd5f | ||
--> |
Oops, something went wrong.
e930b5c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
e930b5c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/123353
Tip: Release Notes
Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.
To add them here just re-invoke and the PR will be updated.
Tagging
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: