Skip to content

Commit

Permalink
Add pre-commit for license
Browse files Browse the repository at this point in the history
  • Loading branch information
adrybakov committed Apr 12, 2024
1 parent 43a49a2 commit b12b73c
Show file tree
Hide file tree
Showing 581 changed files with 112,215 additions and 110,346 deletions.
10 changes: 5 additions & 5 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ body:
python3 -m radtools
```
or (version >= 0.8 < 0.8.4)
```bash
```bash
python3 -m radtools --info
```
```
or (version < 0.8)
```bash
python3 -c "exec('from radtools import __version__\nprint(__version__)')"
python3 -c "exec('from radtools import __version__\nprint(__version__)')"
```
in your terminal to check the version and commit hash of RAD-tools.
- type: input
Expand Down Expand Up @@ -69,8 +69,8 @@ body:
label: OS
description: What operating system are you using?
options:
- MacOS
- Linux
- MacOS
- Linux
- Windows
validations:
required: true
Expand Down
14 changes: 7 additions & 7 deletions .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ body:
label: OS
description: What operating system are you using?
options:
- MacOS
- Linux
- MacOS
- Linux
- Windows
validations:
required: true
Expand All @@ -50,22 +50,22 @@ body:
python3 -m radtools
```
or (version >= 0.8 < 0.8.4)
```bash
```bash
python3 -m radtools --info
```
```
or (version < 0.8)
```bash
python3 -c "exec('from radtools import __version__\nprint(__version__)')"
python3 -c "exec('from radtools import __version__\nprint(__version__)')"
```
in your terminal to check the version and commit hash of RAD-tools.
- type: input
id: version
attributes:
label: RAD-tools version
description: What version of our software are you running?
description: What version of our software are you running?
placeholder: ex. 0.8.0
validations:
required: false
required: false
- type: input
id: commit
attributes:
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Run unit and doc tests

on:
on:
workflow_call:
inputs:
python-version:
Expand All @@ -19,16 +19,16 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}

- name: Install package dependencies
run: pip install -r requirements.txt

- name: Install utest dependencies
run: pip install -r utest/requirements.txt

- name: Install the package
run: pip install .
run: pip install .

- name: Run unit tests
run: make test

Expand All @@ -41,27 +41,27 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}

- name: Install package dependencies
run: pip install -r requirements.txt

- name: Install docs dependencies
run: pip install -r docs/requirements.txt

- name: Install Plotly
run: pip install plotly

- name: Install the package
run: pip install .
run: pip install .

- name: Make examples
run: make examples

- name: Make pictures
run: make bravais-pictures

- name: Build documentation
run: make html

- name: Run doctests
run: make doctest
4 changes: 2 additions & 2 deletions .github/workflows/test-dev.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Test dev branch

on:
on:
pull_request:
branches: [ dev ]

Expand All @@ -14,7 +14,7 @@ jobs:
uses: adrybakov/rad-tools/.github/workflows/run-tests.yml@stable
with:
python-version: '3.9'

test-310:
uses: adrybakov/rad-tools/.github/workflows/run-tests.yml@stable
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-stable.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Test stable branch

on:
on:
push:
branches: [ stable ]
pull_request:
Expand All @@ -16,7 +16,7 @@ jobs:
uses: adrybakov/rad-tools/.github/workflows/run-tests.yml@stable
with:
python-version: '3.9'

test-310:
uses: adrybakov/rad-tools/.github/workflows/run-tests.yml@stable
with:
Expand Down
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,12 @@ repos:
hooks:
- id: black
language_version: python3.11
- repo: https://github.com/adrybakov/pre-commit-hooks
rev: 0.2.0
hooks:
- id: license-headers
args:
- --license-file
- L-HEADER
- --update-year
- --verbose
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ python:
- requirements: docs/requirements.txt
- requirements: requirements.txt
- method: pip
path: .
path: .
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@
"voronoi"
],
"search.useIgnoreFiles": true,
}
}
17 changes: 17 additions & 0 deletions L-HEADER
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
RAD-tools - Sandbox (mainly condense matter plotting).
Copyright (C) 2022-2024 Andrey Rybakov

e-mail: [email protected], web: rad-tools.org

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ help:
@echo

# $(O) is meant as a shortcut for $(SPHINXOPTS).
html:
html:
@$(SPHINXBUILD) -M html "docs/$(SOURCEDIR)" "docs/$(BUILDDIR)" $(SPHINXOPTS) $(O)

clean-html: clean install html
Expand All @@ -45,7 +45,7 @@ clean-html: clean install html
html-examples: examples bravais-pictures
@$(SPHINXBUILD) -M html "docs/$(SOURCEDIR)" "docs/$(BUILDDIR)" $(SPHINXOPTS) $(O)

doctest:
doctest:
@$(SPHINXBUILD) -b doctest "docs/$(SOURCEDIR)" "docs/$(BUILDDIR)" $(SPHINXOPTS) $(O)

clean:
Expand Down Expand Up @@ -75,7 +75,7 @@ clean:
install:
@python3 -m pip install .

test:
test:
@pytest -s

test-all: clean install test bravais-pictures examples html doctest
Expand All @@ -88,7 +88,7 @@ pip: prepare-release
-@rm -r dist
-@rm -r build
-@rm -r radtools.egg-info
@python3 setup.py sdist bdist_wheel
@python3 setup.py sdist bdist_wheel
@python3 -m twine upload --repository pypi dist/* --verbose
@git tag -a "v$(VERSION)" -m "Version $(VERSION)"
@git push origin "v$(VERSION)"
Expand All @@ -107,8 +107,8 @@ docs-pictures:
new-script:
@python3 tools/new-script.py -n $(NAME)

examples:
@python3 tools/plot-script-guide.py -s $(SCRIPT)
examples:
@python3 tools/plot-script-guide.py -s $(SCRIPT)

generate-script-docs:
@python3 tools/generate-script-docs.py -s $(SCRIPT)
generate-script-docs:
@python3 tools/generate-script-docs.py -s $(SCRIPT)
Loading

0 comments on commit b12b73c

Please sign in to comment.