Skip to content

Commit

Permalink
feat: Add pixi environment (#2361)
Browse files Browse the repository at this point in the history
* Add pixi environment
   - Restrict ruby to v3.1 to match the version used in CI for deployment.
     The Ruby version and the Gemfile.lock can get updated later.

* Only ignore Gemfile.lock, not all lock file types

* Add instructions on using pixi for local development
   - Add basic pixi setup and use instructions.
   - Place existing rbenv instructions under 'Manual environment control' section.
  • Loading branch information
matthewfeickert authored Aug 8, 2024
1 parent c360c81 commit de15ddf
Show file tree
Hide file tree
Showing 5 changed files with 3,151 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@

*.min.* binary
# GitHub syntax highlighting
pixi.lock linguist-language=YAML linguist-generated=true
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
*.lock
*~
*.swp
.DS_Store
Expand All @@ -18,3 +17,6 @@ node_modules/
package.json
.ipynb_checkpoints/
.jekyll-cache/
# pixi environments
.pixi
*.egg-info
49 changes: 46 additions & 3 deletions pages/docs/webdev.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ The website source is available at <https://github.com/iris-hep/iris-hep.github.

You can always click the edit button to make small edits to the website source, but if you want to test locally or make larger edits, you'll want to clone the source for the website and build it with Ruby.

### Installing Ruby
### Manual environment control

#### Installing Ruby

Visit [this page](https://jekyllrb.com/docs/installation/) for information about installing Ruby if your current version is too old; the instructions there form the basis for what you see here, and come in variants for all major operating systems.
You should have Ruby 2.6+ for Jekyll; 3.1 recommended and used in CI. You can use rbenv to manage multiple ruby versions. On macOS with homebrew, you'll want:
Expand Down Expand Up @@ -42,8 +44,7 @@ gem install bundle
you don't have permission to install, and you are using rbenv, this means you
forgot to set it up with `rbenv init`.)


### Running locally
#### Running locally

The site is built with Jekyll, and is easy to run locally if you have Ruby.

Expand Down Expand Up @@ -77,6 +78,48 @@ bundle exec rake checkall

If you are not familiar with it, `rake` is short for "Ruby make". The `clean` and `clobber` targets are available (the later removes the Inspire-HEP cache as well). You can also run `bundle exec jekyll ...` directly.

### Using `pixi`

#### Setup

[Install `pixi`](https://pixi.sh/latest/#installation) and then (optionally) from the top level of the repository run

```console
pixi install
```

#### Running locally

Use the `pixi` task runner to execute the tasks defined in `pixi.toml`, which can be listed at the command line with

```console
pixi task list
```

or

```console
pixi info
```

First install the local Ruby "bundle"

```console
pixi run install
```

and then run any defined task with `pixi run` such as building and serving the website with

```console
pixi run serve
```

Any of the commands shown above in the "manual environment control" section above can be used by launching an interactive shell with the `pixi` environment activated with

```console
pixi shell
```

### Updating javascript files

If you add or change a javascript file, you need to edit the page `/includes/head.html` and add the new hash in the identity part of the script include. You can generate the hash for a file, like `assets/js/myfile.js`, using:
Expand Down
Loading

0 comments on commit de15ddf

Please sign in to comment.