Skip to content

Commit

Permalink
merge fresh main
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjanovsky committed Nov 14, 2023
2 parents 80190b0 + 1ccca9a commit b7b85a1
Show file tree
Hide file tree
Showing 37 changed files with 2,410 additions and 313 deletions.
1 change: 0 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
run: sudo apt-get install build-essential libpoppler-cpp-dev pkg-config python3-dev -y
- name: Install sec-certs and deps
run: |
pip install -r requirements/requirements.txt
pip install -r requirements/dev_requirements.txt
pip install -e .
- name: Build docs
Expand Down
44 changes: 0 additions & 44 deletions .github/workflows/lint.yml

This file was deleted.

18 changes: 18 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Lint (Ruff, MyPy)
on:
push:
workflow_dispatch:
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Install dependencies
run: |
sudo apt-get install build-essential libpoppler-cpp-dev pkg-config python3-dev -y
pip install -r requirements/dev_requirements.txt
- name: Run pre-commit
run: pre-commit run --all-files
2 changes: 0 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ jobs:
python-version: "3.8"
cache: "pip"
cache-dependency-path: |
requirements/requirements.txt
requirements/test_requirements.txt
- name: Install python dependencies
run: |
pip install -r requirements/requirements.txt
pip install -r requirements/test_requirements.txt
- name: Install sec-certs
run: |
Expand Down
14 changes: 5 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
repos:
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
args: ["--check", "--target-version", "py38"]
- repo: https://github.com/charliermarsh/ruff-pre-commit
# Ruff version.
rev: "v0.0.239"
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.5
hooks:
- id: ruff
- id: ruff-format
args: ["--check"]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.3.0"
rev: "v1.6.1"
hooks:
- id: mypy
additional_dependencies:
Expand Down
7 changes: 3 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Requirements are maintained with [pip-tools](https://github.com/jazzband/pip-too
- List actual dependencies in [pyproject.toml](https://github.com/crocs-muni/sec-certs/blob/main/pyproject.toml) without pinning them.
- Additionally, [compile.sh](https://github.com/crocs-muni/sec-certs/blob/main/requirements/compile.sh) script is used to compile pinned versions of requirements that reside in `.txt` files in the same folder.
- Tests, linting and Docker all run against this reproducible environment of pinned requirements.
- To install all requirements, use `pip install -U pip-tools && pip-sync requirements/all_requirements.txt`

## Branches

Expand All @@ -43,9 +44,7 @@ Note on single-sourcing the package version: More can be read [here](https://pac
All commits shall pass the lint pipeline of the following tools:

- Mypy (see [pyproject.toml](https://github.com/crocs-muni/sec-certs/blob/main/pyproject.toml) for settings)
- Black (see [pyproject.toml](https://github.com/crocs-muni/sec-certs/blob/main/pyproject.toml) for settings)
- Ruff (see [pyproject.toml](https://github.com/crocs-muni/sec-certs/blob/main/pyproject.toml) for settings)
- PyUpgrade

These tools can be installed via [dev_requirements.txt](https://github.com/crocs-muni/sec-certs/blob/main/dev_requirements.txt) You can use [pre-commit](https://pre-commit.com/) tool to register git hook that will evalute these checks prior to any commit and abort the commit for you. Note that the pre-commit is not meant to automatically fix the issues, just warn you.

Expand All @@ -59,12 +58,12 @@ pre-commit run --all-files

To ivoke the tools manually, you can, in the repository root, use:
- Mypy: `mypy .`
- Black: `black --check .` (without the flag to reformat)
- Ruff: `ruff ." (or with `--fix` flag to apply fixes)
- Ruff formatL `ruff format --check .`

## Documentation

Every public method of a module that can be leveraged as an API by user should be documented. The docstrng style should
be `sphinx-oneline`.

The documentation is built using `sphinx` with `mnyst` extension that allows for markdown files. Folder `notebooks/examples` is symbolically linked to `/docs` and its contents will be automatically parsed. These notebooks are supposed to be runnable from Binder.
The documentation is built using `sphinx` with `mnyst` extension that allows for markdown files. Folder `notebooks/examples` is symbolically linked to `/docs` and its contents will be automatically parsed. These notebooks are supposed to be runnable from Binder.
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,14 @@ ENV PATH="${VENV_PATH}/bin:$PATH"

# Install dependencies, notebook is because of mybinder.org
RUN \
pip3 install -U pip && \
pip3 install wheel && \
pip3 install -r requirements/requirements.txt && \
pip3 install -U pip wheel pip-tools && \
pip-sync requirements/all_requirements.txt && \
pip3 install --no-cache notebook jupyterlab && \
pip3 install -e . && \
python3 -m spacy download en_core_web_sm

# just to be sure that pdftotext is in $PATH
ENV PATH /usr/bin/pdftotext:${PATH}

# # Run the application:
# CMD ["python3", "./cc_cli.py"]
# Run the application:
ENTRYPOINT ["sec-certs"]
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

![](docs/_static/logo.png)

A tool for data scraping and analysis of security certificates from Common Criteria and FIPS 140-2/3 frameworks. This project is developed by the [Centre for Research On Cryptography and Security](https://crocs.fi.muni.cz) at Masaryk University, Czech Republic.
A tool for data scraping and analysis of security certificates from Common Criteria and FIPS 140-2/3 frameworks.

<!-- This project is developed by the [Centre for Research On Cryptography and Security](https://crocs.fi.muni.cz) at Masaryk University, Czech Republic. -->

[![Website](https://img.shields.io/website?down_color=red&down_message=offline&style=flat-square&up_color=SpringGreen&up_message=online&url=https%3A%2F%2Fseccerts.org)](https://seccerts.org)
[![Website](https://img.shields.io/website?label=docs&down_color=red&down_message=offline&style=flat-square&up_color=SpringGreen&up_message=online&url=https%3A%2F%2Fseccerts.org/docs/index.html)](https://seccerts.org/docs/index.html)
Expand Down Expand Up @@ -58,8 +60,8 @@ df_2015_and_newer = df.loc[df.year_from > 2014]
df.year_from.value_counts().sort_index().plot.line()
```

## Authors
<!-- ## Authors
This work is being done at [CRoCS MUNI](https://crocs.fi.muni.cz/) by Adam Janovsky, Jan Jancar, Petr Svenda, Jiri Michalik, Lukasz Chmielewski and other contributors. This work was supported by the Internal grant agency of Masaryk University, CZ.02.2.69/0.0/0.0/19_073/0016943.
![](docs/_static/logolink_OP_VVV_hor_barva_eng.jpg)
![](docs/_static/logolink_OP_VVV_hor_barva_eng.jpg) -->
3 changes: 2 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
# -- Project information -----------------------------------------------------

project = "sec-certs"
copyright = "CRoCS MUNI | 2020-2023"
copyright = "Anonymized | 2020-2023"
# copyright = "CRoCS MUNI | 2020-2023"

# Note thas this inference won't work from Docker: https://github.com/pypa/setuptools_scm/#usage-from-docker
release = ".".join(get_version("sec-certs").split(".")[:3])
Expand Down
3 changes: 1 addition & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ Each of the notebooks can be launched interactively in MyBinder by clicking on
:maxdepth: 1
Seccerts homepage <https://seccerts.org/>
Seccerts docs <https://seccerts.org/docs>
GitHub repo <https://github.com/crocs-muni/sec-certs>
Seccerts PyPi <https://pypi.org/project/sec-certs/>
GitHub repo <https://anonymous.4open.science/r/sec-certs-7A92>
```

```{toctree}
Expand Down
Loading

0 comments on commit b7b85a1

Please sign in to comment.