Skip to content

Commit db5d0c2

Browse files
committed
Add all code
0 parents  commit db5d0c2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+4960
-0
lines changed

.github/workflows/docs_to_pages.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Docs to Pages
2+
on:
3+
workflow_dispatch:
4+
5+
jobs:
6+
build-docs:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
- uses: actions/setup-python@v3
11+
with:
12+
python-version: '3.10'
13+
- name: Install poetry
14+
uses: abatilo/[email protected]
15+
- name: Install docs building dependencies
16+
run: |
17+
python3 -m pip install --upgrade pip
18+
make install-docs
19+
- name: Build documentation
20+
run: |
21+
pushd doc
22+
poetry run make html
23+
touch build/html/.nojekyll
24+
popd
25+
- name: Deploy 🚀
26+
uses: JamesIves/github-pages-deploy-action@v4
27+
with:
28+
folder: doc/build/html
29+
branch: docs
+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Publish Release to PyPI
2+
on:
3+
release:
4+
types: [published]
5+
workflow_dispatch:
6+
jobs:
7+
publish:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
- name: Set up Python
12+
uses: actions/setup-python@v3
13+
with:
14+
python-version: '3.10'
15+
- name: Install poetry
16+
uses: abatilo/[email protected]
17+
- name: Install project dependencies
18+
run: |
19+
python3 -m pip install --upgrade pip
20+
make install-extras
21+
- name: Set package version
22+
run: poetry version "${{ github.event.release.tag_name }}"
23+
- name: Build the Package
24+
run: poetry build
25+
- name: Update Release with Built Package
26+
uses: softprops/action-gh-release@v1
27+
with:
28+
tag_name: "${{ github.event.release.tag_name }}"
29+
files: |
30+
dist/*
31+
- name: run tests
32+
# Only run tests for skillsnetwork since cv studio tests not working from CI
33+
run: poetry run pytest tests/ -k 'test_skillsnetwork.py'
34+
- name: Publish package
35+
uses: pypa/gh-action-pypi-publish@release/v1
36+
with:
37+
user: __token__
38+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/test.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Test
2+
on:
3+
push:
4+
jobs:
5+
test:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v3
9+
- name: Set up Python
10+
id: setup-python
11+
uses: actions/setup-python@v3
12+
with:
13+
python-version: '3.10'
14+
- name: Install Poetry
15+
uses: snok/install-poetry@v1
16+
with:
17+
virtualenvs-create: true
18+
virtualenvs-in-project: true
19+
installer-parallel: true
20+
- name: Load cached venv
21+
id: cached-poetry-dependencies
22+
uses: actions/cache@v2
23+
with:
24+
path: .venv
25+
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
26+
- name: Install dependencies
27+
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
28+
run: poetry install -E regular --no-interaction --no-root
29+
- run: poetry install --no-interaction
30+
- name: check style
31+
run: poetry run black . --check
32+
- name: run tests
33+
# Only run tests for skillsnetwork since cv studio tests not working from CI
34+
run: poetry run pytest tests/ -k 'test_skillsnetwork.py'

.gitignore

+149
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
**/.DS_Store
4+
*.py[cod]
5+
*$py.class
6+
7+
# C extensions
8+
*.so
9+
10+
# Distribution / packaging
11+
.Python
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
wheels/
24+
pip-wheel-metadata/
25+
share/python-wheels/
26+
*.egg-info/
27+
.installed.cfg
28+
*.egg
29+
MANIFEST
30+
31+
# PyInstaller
32+
# Usually these files are written by a python script from a template
33+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
34+
*.manifest
35+
*.spec
36+
37+
# Installer logs
38+
pip-log.txt
39+
pip-delete-this-directory.txt
40+
41+
# Unit test / coverage reports
42+
htmlcov/
43+
.tox/
44+
.nox/
45+
.coverage
46+
.coverage.*
47+
.cache
48+
nosetests.xml
49+
coverage.xml
50+
*.cover
51+
*.py,cover
52+
.hypothesis/
53+
.pytest_cache/
54+
55+
# Other test artifacts
56+
test.txt
57+
58+
# Translations
59+
*.mo
60+
*.pot
61+
62+
# Django stuff:
63+
*.log
64+
local_settings.py
65+
db.sqlite3
66+
db.sqlite3-journal
67+
68+
# Flask stuff:
69+
instance/
70+
.webassets-cache
71+
72+
# Scrapy stuff:
73+
.scrapy
74+
75+
# Sphinx documentation
76+
docs/_build/
77+
78+
# PyBuilder
79+
target/
80+
81+
# Jupyter Notebook
82+
.ipynb_checkpoints
83+
*.ipynb
84+
85+
# IPython
86+
profile_default/
87+
ipython_config.py
88+
89+
# pyenv
90+
.python-version
91+
92+
# pipenv
93+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
94+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
95+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
96+
# install all needed dependencies.
97+
#Pipfile.lock
98+
99+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
100+
__pypackages__/
101+
102+
# Celery stuff
103+
celerybeat-schedule
104+
celerybeat.pid
105+
106+
# SageMath parsed files
107+
*.sage.py
108+
109+
# Environments
110+
.env
111+
.venv
112+
env/
113+
venv/
114+
ENV/
115+
env.bak/
116+
venv.bak/
117+
118+
# Spyder project settings
119+
.spyderproject
120+
.spyproject
121+
122+
# Rope project settings
123+
.ropeproject
124+
125+
# mkdocs documentation
126+
/site
127+
128+
# mypy
129+
.mypy_cache/
130+
.dmypy.json
131+
dmypy.json
132+
133+
# Pyre type checker
134+
.pyre/
135+
136+
# jupyterlite
137+
_output/
138+
.jupyterlite.doit.db
139+
140+
# local pypi
141+
local-pypi/skillsnetwork/*
142+
143+
# Sphinx-built docs
144+
doc/build
145+
doc/source/**/generated/
146+
147+
# Environment files
148+
**/.env
149+
**/.env.test

CONTRIBUTING.md

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Contributing
2+
3+
## Prerequisites
4+
5+
### Poetry
6+
Install `poetry`
7+
8+
```bash
9+
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
10+
```
11+
12+
Learn more about poetry at https://python-poetry.org/
13+
14+
### Make
15+
16+
`make` is included with xcode. If you don't already have it install it:
17+
```bash
18+
xcode-select --install
19+
```
20+
21+
## Development for JupyterLab
22+
23+
1. run a local JupyterLab instance:
24+
```bash
25+
make jupyterlab-dev
26+
```
27+
28+
then go to http://localhost:8888
29+
30+
1. make changes to the `skillsnetwork` package
31+
1. restart your kernel
32+
1. test your changes
33+
34+
## Development for JupyterLite
35+
36+
1. run a local pypi instance:
37+
```bash
38+
make local-pypi
39+
```
40+
41+
1. run a local JupyterLite instance:
42+
```bash
43+
make jupyterlite-dev
44+
```
45+
46+
then go to http://localhost:8000
47+
48+
49+
1. install the package in JupyterLite (note: your version may be different. You can go to http://localhost:3000/skillsnetwork to see available versions):
50+
```python
51+
import piplite
52+
await piplite.install("http://localhost:3000/skillsnetwork/skillsnetwork-0.0.0-py3-none-any.whl")
53+
```
54+
55+
1. make changes to the `skillsnetwork` package
56+
1. stop the local pypi server with Ctrl+c, then re-start it with `make local-pypi`
57+
1. restart your kernel
58+
1. reinstall the package to get the latest changes
59+
1. test your changes
60+
61+
## Publishing
62+
63+
To publish a new version of the package on PyPI, create a new GitHub release. Pre-releasese are supported and will also be published to PyPI (as pre-releases).

0 commit comments

Comments
 (0)