Skip to content

Commit 8e3f632

Browse files
authored
fix: Fix makim config and dependencies with poetry (#164)
1 parent 7ffbf13 commit 8e3f632

File tree

40 files changed

+3186
-210
lines changed

40 files changed

+3186
-210
lines changed

.editorconfig

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# http://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
indent_style = space
7+
indent_size = 2
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
charset = utf-8
11+
end_of_line = lf
12+
13+
[*.py]
14+
indent_style = space
15+
indent_size = 4
16+
17+
[*.bat]
18+
indent_style = tab
19+
end_of_line = crlf
20+
21+
["LICENSE"]
22+
insert_final_newline = true
23+
24+
["Makefile"]
25+
indent_style = tab

.github/workflows/main.yaml

Lines changed: 35 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
21
name: main
32

43
on:
54
push:
6-
branches: [ main ]
5+
branches: [main]
76
pull_request:
8-
branches: [ main ]
7+
branches: [main]
98

109
jobs:
1110
check-branch:
@@ -36,26 +35,36 @@ jobs:
3635
run:
3736
shell: bash -l {0}
3837
steps:
39-
- uses: actions/checkout@v3
40-
41-
- uses: conda-incubator/setup-miniconda@v3
42-
with:
43-
miniconda-version: "latest"
44-
environment-file: conda/dev.yaml
45-
channels: conda-forge,nodefaults
46-
activate-environment: osl-web
47-
auto-update-conda: true
48-
conda-solver: libmamba
49-
50-
- name: Build the book
51-
run: |
52-
makim pages.build
53-
echo "opensciencelabs.org" > build/CNAME
54-
55-
# Push the book's HTML to github-pages
56-
- name: GitHub Pages action
57-
uses: peaceiris/[email protected]
58-
if: ${{ github.event_name == 'push' }}
59-
with:
60-
github_token: ${{ secrets.GITHUB_TOKEN }}
61-
publish_dir: ./build
38+
- uses: actions/checkout@v3
39+
40+
- uses: conda-incubator/setup-miniconda@v3
41+
with:
42+
miniconda-version: "latest"
43+
environment-file: conda/dev.yaml
44+
channels: conda-forge,nodefaults
45+
activate-environment: osl-web
46+
auto-update-conda: true
47+
conda-solver: libmamba
48+
49+
- name: Install dependencies
50+
run: |
51+
poetry check
52+
poetry install
53+
54+
- name: Linter
55+
run: |
56+
pre-commit install
57+
pre-commit run --all-file
58+
59+
- name: Build the book
60+
run: |
61+
makim pages.build
62+
echo "opensciencelabs.org" > build/CNAME
63+
64+
# Push the book's HTML to github-pages
65+
- name: GitHub Pages action
66+
uses: peaceiris/[email protected]
67+
if: ${{ github.event_name == 'push' }}
68+
with:
69+
github_token: ${{ secrets.GITHUB_TOKEN }}
70+
publish_dir: ./build

.makim.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
version: 1.0
21
groups:
32
pages:
43
tasks:
54
pre-build:
65
help: pre-build step
7-
shell: bash
6+
backend: bash
87
run: |
98
mkdir -p build
109
# Directory to search for .ipynb files
@@ -23,12 +22,14 @@ groups:
2322
2423
build:
2524
help: build the static page
26-
dependencies:
27-
- task: pages.pre-build
25+
hooks:
26+
pre-run:
27+
- task: pages.pre-build
2828
run: mkdocs build --verbose --clean
2929

3030
preview:
3131
help: preview the web page dynamically
32-
dependencies:
33-
- task: pages.pre-build
32+
hooks:
33+
pre-run:
34+
- task: pages.pre-build
3435
run: mkdocs serve --watch pages --watch theme

.pre-commit-config.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
default_stages:
2+
- pre-commit
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v4.6.0
6+
hooks:
7+
- id: trailing-whitespace
8+
exclude: "pages/blog"
9+
- id: end-of-file-fixer
10+
exclude: "pages/blog"
11+
- id: check-json
12+
- id: check-toml
13+
- id: check-xml
14+
- id: check-builtin-literals
15+
- id: check-case-conflict
16+
- id: check-docstring-first
17+
- id: detect-private-key
18+
exclude: "theme"
19+
20+
- repo: https://github.com/pre-commit/mirrors-prettier
21+
rev: "v3.0.2"
22+
hooks:
23+
- id: prettier
24+
exclude: "pages/blog|theme"

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docs/changelog.md

.prettierrc.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
overrides:
2+
- files: "*.md"
3+
options:
4+
parser: remark
5+
proseWrap: always
6+
printWidth: 80

CODE_OF_CONDUCT.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ We as members, contributors, and leaders pledge to make participation in our
66
community a harassment-free experience for everyone, regardless of age, body
77
size, visible or invisible disability, ethnicity, sex characteristics, gender
88
identity and expression, level of experience, education, socio-economic status,
9-
nationality, personal appearance, race, religion, or sexual identity
10-
and orientation.
9+
nationality, personal appearance, race, religion, or sexual identity and
10+
orientation.
1111

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

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

2828
Examples of unacceptable behavior include:
2929

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

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

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

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

8383
### 2. Warning
8484

85-
**Community Impact**: A violation through a single incident or series
86-
of actions.
85+
**Community Impact**: A violation through a single incident or series of
86+
actions.
8787

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

9595
### 3. Temporary Ban
9696

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

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

112-
**Consequence**: A permanent ban from any sort of public interaction within
113-
the community.
112+
**Consequence**: A permanent ban from any sort of public interaction within the
113+
community.
114114

115115
## Attribution
116116

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

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

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

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BSD 3-Clause License
22

3-
Copyright (c) 2022, thegraphnetwork
3+
Copyright (c) 2022, Open Science Labs
44
All rights reserved.
55

66
Redistribution and use in source and binary forms, with or without

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,20 @@ cd opensciencelabs.github.io
1212
```
1313

1414
```bash
15-
mamba env create -f conda/dev.yaml
15+
mamba env create -f conda/dev.yaml --yes
16+
conda activate osl-web
17+
poetry install
1618
```
1719

1820
```bash
1921
makim pages.preview
2022
```
23+
24+
## Linter
25+
26+
Ensure you have installed the pre-commit config locally:
27+
28+
```bash
29+
# with your conda env active, run:
30+
$ pre-commit install
31+
```

conda/dev.yaml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,4 @@ channels:
55
dependencies:
66
- python <3.12
77
- pip
8-
- pip:
9-
- pre-commit
10-
- mkdocs ==1.4.2
11-
- makim
12-
- mkdocs-blogging-plugin
13-
- mkdocs-rss-plugin <1.9.0
14-
- jupyterlab
15-
- nbconvert
16-
- pymdown-extensions
8+
- poetry

0 commit comments

Comments
 (0)