Skip to content

Commit

Permalink
fix(dependencies): upgrade hyfi to 0.15.0
Browse files Browse the repository at this point in the history
  • Loading branch information
entelecheia committed Jun 28, 2023
1 parent 2cf6e95 commit cc9463b
Show file tree
Hide file tree
Showing 58 changed files with 2,371 additions and 26 deletions.
11 changes: 9 additions & 2 deletions .copier-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Changes here will be overwritten by Copier; do NOT edit manually
_commit: v0.8.4
_commit: v0.11.3
_src_path: gh:entelecheia/hyperfast-python-template
author: Young Joon Lee
build_and_release: true
code_template_answers_file: .copier-hyfi-config.yaml
code_template_source: ''
code_template_source: gh:entelecheia/hyfi-template
codecov_graph_token: '[REPLACE_ME]'
copyright_year: 2023
documentaion_tool: jupyter-book
documentation_url: https://entelecheia.github.io/corporate-reputation
Expand All @@ -15,7 +16,13 @@ github_repo_name: corporate-reputation
github_username: entelecheia
google_analytics_id: G-Q1HTTH4YZ2
logo_path: ''
main_branch: main
package_name: corprep
package_scripts:
- corprep = 'corprep.__cli__:main'
poe_task_files:
- .tasks.toml
- .tasks-extra.toml
project_description: 'The reputation of a company and its CEO forms an intangible
asset that significantly influences organizational success. With digital media
becoming the central stage for public opinion formation, understanding and quantifying
Expand Down
6 changes: 6 additions & 0 deletions .copier-hyfi-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changes here will be overwritten by Copier; do NOT edit manually
_commit: v0.3.13
_src_path: gh:entelecheia/hyfi-template
package_name: corprep
project_name: corporate-reputation

4 changes: 4 additions & 0 deletions .github/workflows/deploy-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ jobs:
with:
python-version: 3.x

# install the source code
- name: Install the source code
run: pip install .

# Build the book
- name: Build the book
run: |
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/lint_and_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,8 @@ jobs:
echo '```' >> $GITHUB_STEP_SUMMARY
echo '\n\n\n'
# add pytest coverage report to PR
- name: Pytest coverage comment
if: ${{ success() && github.event_name == 'pull_request' }}
id: coverageComment
uses: MishaKav/pytest-coverage-comment@main
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
title: Coverage Report
pytest-coverage-path: tests/pytest-coverage.txt
junitxml-path: tests/pytest.xml
fail_ci_if_error: false # optional (default = false)
verbose: true # optional (default = false)
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# hypothesis: https://github.com/HypothesisWorks/hypothesis
.hypothesis/
.vscode/

# Ignore node_modules directory
node_modules/

# Jupyter Notebook
_build/
_autosummary/

# Python
*.py[cod]
Expand Down
20 changes: 20 additions & 0 deletions .tasks-extra.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[tool.poe.tasks.add-editable-hyfi]
shell = """
poetry remove hyfi
poetry add --group dev --editable ../hyfi
"""
help = "Add hyfi as an editable dependency"

[tool.poe.tasks.apply-hyfi-template]
cmd = """
copier --answers-file .copier-hyfi-config.yaml gh:entelecheia/hyfi-template .
"""
use_exec = true
help = "Apply hyfi template"

[tool.poe.tasks.copy-hyfi-config]
shell = """
poetry add hyfi@latest
poetry run hyfi cmd=copy_conf copier.dst_path=src/corprep/conf copier.exclude='**/*/about/__init__.yaml' copier.overwrite=True
"""
help = "Copy hyfi conf to src/corprep/conf"
20 changes: 15 additions & 5 deletions .tasks.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ cmd = "pytest --doctest-modules"
help = "run tests with pytest"

[tool.poe.tasks.tests-cov]
cmd = "pytest --doctest-modules --cov=src --cov-report term-missing --cov-report=html"
cmd = "pytest --cov=src --cov-report=xml"
help = "run tests with pytest and generate a coverage report"

[tool.poe.tasks.tests-cov-fail]
shell = "pytest --doctest-modules --cov=src --cov-report term-missing --cov-report=html --cov-fail-under=80 --junitxml=tests/pytest.xml | tee tests/pytest-coverage.txt"
shell = "pytest --cov=src --cov-report=xml --cov-fail-under=50 --junitxml=tests/pytest.xml | tee tests/pytest-coverage.txt"
help = "run tests with pytest and generate a coverage report, fail if coverage is below 80%"

[tool.poe.tasks.clean-cov]
cmd = "rm -rf .coverage tests/htmlcov tests/pytest.xml tests/pytest-coverage.txt"
cmd = "rm -rf .coverage* tests/htmlcov tests/pytest.xml tests/pytest-coverage.txt"
help = "remove coverage reports"

[tool.poe.tasks.clean-pycache]
Expand Down Expand Up @@ -78,10 +78,16 @@ help = "build the package"
cmd = "pipx install ghp-import"
help = "install ghp-import"

[tool.poe.tasks.install-jupyter-book]
[tool.poe.tasks.install-jupyter-book-pipx]
shell = """
pipx install jupyter-book
args=(); while IFS= read -r file; do args+=("$file"); done < book/requirements.txt; pipx inject jupyter-book "${args[@]:1}"
pipx inject jupyter-book $(awk '{if(!/^ *#/ && NF) print}' book/requirements.txt)
"""
help = "install jupyter-book with pipx"

[tool.poe.tasks.install-jupyter-book]
shell = """
pip install -r book/requirements.txt
"""
help = "install jupyter-book"

Expand Down Expand Up @@ -112,3 +118,7 @@ help = "update dependencies"
[tool.poe.tasks.lock]
cmd = "poetry lock"
help = "lock dependencies"

[tool.poe.tasks.codecov-validate]
cmd = "curl -X POST --data-binary @codecov.yml https://codecov.io/validate"
help = "Validate codecov.yml"
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ initialize: install-pipx ## initialize the project environment
@pre-commit install

init-project: initialize remove-template ## initialize the project (Warning: do this only once!)
@copier copy --answers-file .copier-config.yaml gh:entelecheia/hyperfast-python-template .
@copier copy --data 'code_template_source=gh:entelecheia/hyfi-template' --answers-file .copier-config.yaml gh:entelecheia/hyperfast-python-template .

reinit-project: install-copier ## reinitialize the project (Warning: this may overwrite existing files!)
@bash -c 'args=(); while IFS= read -r file; do args+=("--skip" "$$file"); done < .copierignore; copier copy "$${args[@]}" --answers-file .copier-config.yaml gh:entelecheia/hyperfast-python-template .'
@bash -c 'args=(); while IFS= read -r file; do args+=("--skip" "$$file"); done < .copierignore; copier copy --UNSAFE "$${args[@]}" --data 'code_template_source=gh:entelecheia/hyfi-template' --answers-file .copier-config.yaml gh:entelecheia/hyperfast-python-template .'
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@
[![version-image]][release-url]
[![release-date-image]][release-url]
[![license-image]][license-url]
[![codecov][codecov-image]][codecov-url]
[![jupyter-book-image]][docs-url]

<!-- Links: -->
[codecov-image]: https://codecov.io/gh/entelecheia/corporate-reputation/branch/main/graph/badge.svg?token=[REPLACE_ME]
[codecov-url]: https://codecov.io/gh/entelecheia/corporate-reputation
[pypi-image]: https://img.shields.io/pypi/v/corporate-reputation
[license-image]: https://img.shields.io/github/license/entelecheia/corporate-reputation
[license-url]: https://github.com/entelecheia/corporate-reputation/blob/main/LICENSE
Expand Down
6 changes: 6 additions & 0 deletions book/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,15 @@ sphinx:
"floor": ["\\lfloor#1\\rfloor", 1]
"bmat": ["\\left[\\begin{array}"]
"emat": ["\\end{array}\\right]"]
add_module_names: false
autosummary_generate: true

extra_extensions:
- sphinx.ext.intersphinx
- sphinx.ext.autodoc
- sphinx.ext.autosummary
- sphinx.ext.napoleon
- sphinx.ext.viewcode
- sphinx_inline_tabs
- sphinx_proof
- sphinx_examples
Expand Down
5 changes: 3 additions & 2 deletions book/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
format: jb-book
root: index
chapters:
- file: usage
- file: examples
- file: usage
- file: api
- file: examples
16 changes: 16 additions & 0 deletions book/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
API Reference
=============

.. autosummary::
:toctree: _autosummary
:recursive:

corprep

main
----
.. autofunction:: corprep.__cli__.main

get_version
-----------
.. autofunction:: corprep.__init__.get_version
3 changes: 3 additions & 0 deletions book/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
[![release-date-image]][release-url]
[![license-image]][license-url]
[![jupyter-book-image]][docs-url]
[![codecov][codecov-image]][codecov-url]

<!-- Links: -->
[hyperfast python template]: https://github.com/entelecheia/hyperfast-python-template

[codecov-image]: https://codecov.io/gh/entelecheia/corporate-reputation/branch/main/graph/badge.svg?token=[REPLACE_ME]
[codecov-url]: https://codecov.io/gh/entelecheia/corporate-reputation
[pypi-image]: https://img.shields.io/pypi/v/corporate-reputation
[license-image]: https://img.shields.io/github/license/entelecheia/corporate-reputation
[license-url]: https://github.com/entelecheia/corporate-reputation/blob/main/LICENSE
Expand Down
12 changes: 12 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# When modifying this file, please validate using
# curl -X POST --data-binary @codecov.yml https://codecov.io/validate
coverage:
status:
project:
default:
target: 50% # the required coverage value
threshold: 10% # the leniency in hitting the target
informational: true
patch:
default:
informational: true
Loading

0 comments on commit cc9463b

Please sign in to comment.