-
-
Notifications
You must be signed in to change notification settings - Fork 204
[WIP] Cookie #1514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
alanlujan91
wants to merge
24
commits into
econ-ark:main
Choose a base branch
from
alanlujan91:cookie
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[WIP] Cookie #1514
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
bfdd6cb
move to src
alanlujan91 64de241
move to docs
alanlujan91 80b6077
move to tests
alanlujan91 bc7e17b
Documentation to docs
alanlujan91 7e44e4d
fix tests
alanlujan91 d673eec
install cookie
alanlujan91 67a048f
dynamic dependencies
alanlujan91 930be4b
doc to docs
alanlujan91 ddde4e7
autodoc
alanlujan91 75c1572
Update Python versions and runs-on platforms in CI workflow
alanlujan91 f801de7
Update references to HARK instead of hark
alanlujan91 61c597d
move examples and fix docs
alanlujan91 c71b837
dont treat warnings as errors
alanlujan91 aea8f34
Update paths for running examples and executing notebooks
alanlujan91 4fcb224
remove latex
alanlujan91 54a871f
Remove check-yaml from pre-commit-config.yaml
alanlujan91 78b73b7
warnings not errors
alanlujan91 24d663a
Update pyproject.toml to set fail-under to 0
alanlujan91 5824dcf
Merge branch 'econ-ark:master' into cookie
alanlujan91 b0078f4
update packaging
alanlujan91 164f56e
Update version in conf.py and fix linting issue in pyproject.toml
alanlujan91 5c77052
Add pytest-cov to dev requirements
alanlujan91 5278944
remove pypy
alanlujan91 0a40818
update git action configs
alanlujan91 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # Changes here will be overwritten by Copier; NEVER EDIT MANUALLY | ||
| _commit: 2024.08.19 | ||
| _src_path: gh:scientific-python/cookie | ||
| backend: hatch | ||
| email: econ-ark@jhuecon.org | ||
| full_name: Econ-ARK Team | ||
| license: MIT | ||
| org: econ-ark | ||
| project_name: HARK | ||
| project_short_description: Heterogeneous Agents Resources and toolKit | ||
| url: https://github.com/econ-ark/HARK | ||
| vcs: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| node: $Format:%H$ | ||
| node-date: $Format:%cI$ | ||
| describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| .git_archival.txt export-subst |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| See the [Scientific Python Developer Guide][spc-dev-intro] for a detailed | ||
| description of best practices for developing scientific packages. | ||
|
|
||
| [spc-dev-intro]: https://learn.scientific-python.org/development/ | ||
|
|
||
| # Quick development | ||
|
|
||
| The fastest way to start with development is to use nox. If you don't have nox, | ||
| you can use `pipx run nox` to run it without installing, or `pipx install nox`. | ||
| If you don't have pipx (pip for applications), then you can install with | ||
| `pip install pipx` (the only case were installing an application with regular | ||
| pip is reasonable). If you use macOS, then pipx and nox are both in brew, use | ||
| `brew install pipx nox`. | ||
|
|
||
| To use, run `nox`. This will lint and test using every installed version of | ||
| Python on your system, skipping ones that are not installed. You can also run | ||
| specific jobs: | ||
|
|
||
| ```console | ||
| $ nox -s lint # Lint only | ||
| $ nox -s tests # Python tests | ||
| $ nox -s docs -- --serve # Build and serve the docs | ||
| $ nox -s build # Make an SDist and wheel | ||
| ``` | ||
|
|
||
| Nox handles everything for you, including setting up an temporary virtual | ||
| environment for each run. | ||
|
|
||
| # Setting up a development environment manually | ||
|
|
||
| You can set up a development environment by running: | ||
|
|
||
| ```bash | ||
| python3 -m venv .venv | ||
| source ./.venv/bin/activate | ||
| pip install -v -e .[dev] | ||
| ``` | ||
|
|
||
| If you have the | ||
| [Python Launcher for Unix](https://github.com/brettcannon/python-launcher), you | ||
| can instead do: | ||
|
|
||
| ```bash | ||
| py -m venv .venv | ||
| py -m install -v -e .[dev] | ||
| ``` | ||
|
|
||
| # Pre-commit | ||
|
|
||
| You should prepare pre-commit, which will help you by checking that commits pass | ||
| required checks: | ||
|
|
||
| ```bash | ||
| pip install pre-commit # or brew install pre-commit on macOS | ||
| pre-commit install # Will install a pre-commit hook into the git repo | ||
| ``` | ||
|
|
||
| You can also/alternatively run `pre-commit run` (changes only) or | ||
| `pre-commit run --all-files` to check even without installing the hook. | ||
|
|
||
| # Testing | ||
|
|
||
| Use pytest to run the unit checks: | ||
|
|
||
| ```bash | ||
| pytest | ||
| ``` | ||
|
|
||
| # Coverage | ||
|
|
||
| Use pytest-cov to generate coverage reports: | ||
|
|
||
| ```bash | ||
| pytest --cov=HARK | ||
| ``` | ||
|
|
||
| # Building docs | ||
|
|
||
| You can build the docs using: | ||
|
|
||
| ```bash | ||
| nox -s docs | ||
| ``` | ||
|
|
||
| You can see a preview with: | ||
|
|
||
| ```bash | ||
| nox -s docs -- --serve | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| version: 2 | ||
| updates: | ||
| # Maintain dependencies for GitHub Actions | ||
| - package-ecosystem: "github-actions" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "weekly" | ||
| groups: | ||
| actions: | ||
| patterns: | ||
| - "*" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| changelog: | ||
| exclude: | ||
| authors: | ||
| - dependabot | ||
| - pre-commit-ci |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| name: CD | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| pull_request: | ||
| push: | ||
| branches: | ||
| - main | ||
| release: | ||
| types: | ||
| - published | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| env: | ||
| # Many color libraries just need this to be set to any value, but at least | ||
| # one distinguishes color depth, where "3" -> "256-bit color". | ||
| FORCE_COLOR: 3 | ||
|
|
||
| jobs: | ||
| dist: | ||
| name: Distribution build | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - uses: hynek/build-and-inspect-python-package@v2 | ||
|
|
||
| publish: | ||
| needs: [dist] | ||
| name: Publish to PyPI | ||
| environment: pypi | ||
| permissions: | ||
| id-token: write | ||
| attestations: write | ||
| contents: read | ||
| runs-on: ubuntu-latest | ||
| if: github.event_name == 'release' && github.event.action == 'published' | ||
|
|
||
| steps: | ||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| name: Packages | ||
| path: dist | ||
|
|
||
| - name: Generate artifact attestation for sdist and wheel | ||
| uses: actions/attest-build-provenance@v1.4.1 | ||
| with: | ||
| subject-path: "dist/*" | ||
|
|
||
| - uses: pypa/gh-action-pypi-publish@release/v1 | ||
| with: | ||
| # Remember to tell (test-)pypi about this repo before publishing | ||
| # Remove this line to publish to PyPI | ||
| repository-url: https://test.pypi.org/legacy/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| pull_request: | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
|
Comment on lines
+5
to
+9
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| env: | ||
| # Many color libraries just need this to be set to any value, but at least | ||
| # one distinguishes color depth, where "3" -> "256-bit color". | ||
| FORCE_COLOR: 3 | ||
|
|
||
| jobs: | ||
| pre-commit: | ||
| name: Format | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.x" | ||
| - uses: pre-commit/action@v3.0.1 | ||
| with: | ||
| extra_args: --hook-stage manual --all-files | ||
| - name: Run PyLint | ||
| run: pipx run nox -s pylint -- --output-format=github | ||
|
|
||
| checks: | ||
| name: Check Python ${{ matrix.python-version }} on ${{ matrix.runs-on }} | ||
| runs-on: ${{ matrix.runs-on }} | ||
| needs: [pre-commit] | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python-version: ["3.10", "3.11", "3.12"] | ||
| runs-on: [ubuntu-latest, windows-latest, macos-14] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| allow-prereleases: true | ||
|
|
||
| - name: Install package | ||
| run: python -m pip install .[test] | ||
|
|
||
| - name: Test package | ||
| run: >- | ||
| python -m pytest -ra --cov --cov-report=xml --cov-report=term | ||
| --durations=20 | ||
|
|
||
| - name: Upload coverage report | ||
| uses: codecov/codecov-action@v4.5.0 | ||
| with: | ||
| token: ${{ secrets.CODECOV_TOKEN }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CD is configured to run on pushes to
main, but other workflows still targetmaster. Align the branch filters so releases/builds run from the repo’s default branch consistently.