Skip to content

fix: Fix makim config and dependencies with poetry #164

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

Merged
merged 7 commits into from
Oct 20, 2024
Merged
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
25 changes: 25 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# http://editorconfig.org

root = true

[*]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true
charset = utf-8
end_of_line = lf

[*.py]
indent_style = space
indent_size = 4

[*.bat]
indent_style = tab
end_of_line = crlf

["LICENSE"]
insert_final_newline = true

["Makefile"]
indent_style = tab
61 changes: 35 additions & 26 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@

name: main

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

jobs:
check-branch:
Expand Down Expand Up @@ -36,26 +35,36 @@ jobs:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3

- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
environment-file: conda/dev.yaml
channels: conda-forge,nodefaults
activate-environment: osl-web
auto-update-conda: true
conda-solver: libmamba

- name: Build the book
run: |
makim pages.build
echo "opensciencelabs.org" > build/CNAME

# Push the book's HTML to github-pages
- name: GitHub Pages action
uses: peaceiris/[email protected]
if: ${{ github.event_name == 'push' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
- uses: actions/checkout@v3

- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
environment-file: conda/dev.yaml
channels: conda-forge,nodefaults
activate-environment: osl-web
auto-update-conda: true
conda-solver: libmamba

- name: Install dependencies
run: |
poetry check
poetry install

- name: Linter
run: |
pre-commit install
pre-commit run --all-file

- name: Build the book
run: |
makim pages.build
echo "opensciencelabs.org" > build/CNAME

# Push the book's HTML to github-pages
- name: GitHub Pages action
uses: peaceiris/[email protected]
if: ${{ github.event_name == 'push' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
13 changes: 7 additions & 6 deletions .makim.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
version: 1.0
groups:
pages:
tasks:
pre-build:
help: pre-build step
shell: bash
backend: bash
run: |
mkdir -p build
# Directory to search for .ipynb files
Expand All @@ -23,12 +22,14 @@ groups:

build:
help: build the static page
dependencies:
- task: pages.pre-build
hooks:
pre-run:
- task: pages.pre-build
run: mkdocs build --verbose --clean

preview:
help: preview the web page dynamically
dependencies:
- task: pages.pre-build
hooks:
pre-run:
- task: pages.pre-build
run: mkdocs serve --watch pages --watch theme
24 changes: 24 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
default_stages:
- pre-commit
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
exclude: "pages/blog"
- id: end-of-file-fixer
exclude: "pages/blog"
- id: check-json
- id: check-toml
- id: check-xml
- id: check-builtin-literals
- id: check-case-conflict
- id: check-docstring-first
- id: detect-private-key
exclude: "theme"

- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.2"
hooks:
- id: prettier
exclude: "pages/blog|theme"
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docs/changelog.md
6 changes: 6 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
overrides:
- files: "*.md"
options:
parser: remark
proseWrap: always
printWidth: 80
52 changes: 26 additions & 26 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
nationality, personal appearance, race, religion, or sexual identity and
orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
Expand All @@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community
- Focusing on what is best not just for us as individuals, but for the overall
community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
- The use of sexualized language or imagery, and sexual attention or advances of
any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email address,
without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities
Expand All @@ -60,8 +60,8 @@ representative at an online or offline event.

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[email protected].
All complaints will be reviewed and investigated promptly and fairly.
[email protected]. All complaints will be reviewed and investigated
promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
Expand All @@ -82,15 +82,15 @@ behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.
**Community Impact**: A violation through a single incident or series of
actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
like social media. Violating these terms may lead to a temporary or permanent
ban.

### 3. Temporary Ban

Expand All @@ -106,20 +106,20 @@ Violating these terms may lead to a permanent ban.
### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.
**Consequence**: A permanent ban from any sort of public interaction within the
community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.

Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2022, thegraphnetwork
Copyright (c) 2022, Open Science Labs
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,20 @@ cd opensciencelabs.github.io
```

```bash
mamba env create -f conda/dev.yaml
mamba env create -f conda/dev.yaml --yes
conda activate osl-web
poetry install
```

```bash
makim pages.preview
```

## Linter

Ensure you have installed the pre-commit config locally:

```bash
# with your conda env active, run:
$ pre-commit install
```
10 changes: 1 addition & 9 deletions conda/dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,4 @@ channels:
dependencies:
- python <3.12
- pip
- pip:
- pre-commit
- mkdocs ==1.4.2
- makim
- mkdocs-blogging-plugin
- mkdocs-rss-plugin <1.9.0
- jupyterlab
- nbconvert
- pymdown-extensions
- poetry
Loading
Loading