Skip to content
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

Pre commit autoformat #846

Merged
merged 23 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
89f5de8
Removed unused imports using autoflake.
lmarini Dec 1, 2023
c4467c1
Ordered imports using isort.
lmarini Dec 1, 2023
96fa88a
Reformatted using black.
lmarini Dec 1, 2023
dfea47f
Setting up pre-commits.
lmarini Dec 4, 2023
81885c1
Ran pre-commit an all files.
lmarini Dec 4, 2023
30ae3c0
Merging main in.
lmarini Dec 12, 2023
e4b9817
Merging main in.
lmarini Dec 20, 2023
d6d7c8e
Working on creating openapi.json without running backend to be used w…
lmarini Dec 20, 2023
6f79212
Fixed `MUI: The Tabs component doesn't accept a Fragment as a child.`
lmarini Dec 20, 2023
6f925cd
Merge branch 'main' into pre-commit-autoformat
lmarini Dec 20, 2023
c41ec91
Fixed runtime error due to replacing `== None` with 'is None'.
lmarini Dec 20, 2023
dc64aef
Fixed runtime error due to replacing `== None` with 'is None'.
lmarini Dec 20, 2023
ca55602
Automatically generate openapi json file using pre-commit hook.
lmarini Jan 5, 2024
80d05a6
Added codegen precommit hook.
lmarini Jan 5, 2024
9c5c5ab
Setting up prettier and eslint.
lmarini Jan 8, 2024
aa77754
First run of prettier.
lmarini Jan 8, 2024
0f095d3
Runnin eslint and prettier as hooks.
lmarini Jan 8, 2024
aa73c1a
Skip codegen directories when running eslint and prettier.
lmarini Jan 8, 2024
5643a7c
Fixing merge.
lmarini Feb 12, 2024
94cf050
Flake8 E711 exception. Required for Beanie query to work.
lmarini Feb 12, 2024
2b65b8f
Fixed search_users_prefix codegen stub.
lmarini Feb 12, 2024
043761f
Fixed beanie query for get_dataset_folders.
lmarini Feb 12, 2024
85d641f
Ignore Flake8 E711 since beanie query do not support `is None`.
lmarini Feb 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[flake8]
max-line-length = 180
extend-ignore = E203, E266, E501, W503, E741, E711
exclude = .svn,CVS,.bzr,.hg,.git,__pycache__,venv/*,src/*,.rst,build
max-complexity=16
2 changes: 1 addition & 1 deletion .github/workflows/backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,4 @@ jobs:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.messagesMeta.outputs.tags }}
file: ./backend/messages.Dockerfile
labels: ${{ steps.messagesMeta.outputs.labels }}
labels: ${{ steps.messagesMeta.outputs.labels }}
2 changes: 1 addition & 1 deletion .github/workflows/codegen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
- name: Run Codegen
working-directory: frontend
run: npm run codegen:v2:test

- name: Verify Changed files
uses: tj-actions/verify-changed-files@v14
id: verify-changed-files
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/helm-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:

- name: Publish to NCSA OpenSource
if: |
github.event_name != 'pull_request'
github.event_name != 'pull_request'
&& github.repository == env.MAIN_REPO
uses: bsord/[email protected]
with:
Expand Down
53 changes: 53 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
repos:
- repo: local
hooks:
- id: extract-openapi
name: extract-openapi
entry: pipenv run extract-openapi
language: system
pass_filenames: false
- repo: local
hooks:
- id: generate-frontend-api-client
name: generate-frontend-api-client
entry: bash -c 'cd frontend && npm run codegen:v2:file'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the trick that makes this command work without backend running?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh im answering myself...
Is it because the script extract-openapi = "python backend/extract-openapi.py app.main:app" can generate openapi.json without actually having a running background?
Does that mean I can also update the github action to eliminate all the steps of starting up all docker stacks?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct

language: system
pass_filenames: false
- repo: local
hooks:
- id: eslint
name: eslint
entry: bash -c "cd frontend && npx eslint --fix src"
language: system
- repo: local
hooks:
- id: prettier
name: prettier
entry: bash -c "cd frontend && npx prettier src --write"
language: system
- repo: https://github.com/psf/black
rev: 23.11.0
hooks:
- id: black
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
args: [ "--profile=black" ]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-yaml
exclude: deployments/kubernetes/charts
- id: end-of-file-fixer
exclude: 'openapi.json|frontend/src/openapi/v2/'
- id: trailing-whitespace
exclude: 'openapi.json|frontend/src/openapi/v2/'
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.6
hooks:
- id: shellcheck
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
hooks:
- id: flake8
2 changes: 1 addition & 1 deletion .run/Clowder2 Dev.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
<toRun name="uvicorn" type="PythonConfigurationType" />
<method v="2" />
</configuration>
</component>
</component>
2 changes: 1 addition & 1 deletion .run/Debug.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
<configuration default="false" name="Debug" type="JavascriptDebugType" uri="http://localhost:3000">
<method v="2" />
</configuration>
</component>
</component>
2 changes: 1 addition & 1 deletion .run/Docker Dev.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
</deployment>
<method v="2" />
</configuration>
</component>
</component>
2 changes: 1 addition & 1 deletion .run/Python tests in tests.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
<option name="_new_targetType" value="&quot;PATH&quot;" />
<method v="2" />
</configuration>
</component>
</component>
2 changes: 1 addition & 1 deletion .run/start.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
<envs />
<method v="2" />
</configuration>
</component>
</component>
2 changes: 1 addition & 1 deletion .run/start_dev.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
<envs />
<method v="2" />
</configuration>
</component>
</component>
2 changes: 1 addition & 1 deletion .run/uvicorn.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
</component>
</component>
3 changes: 3 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,6 @@ sphinx-material = "*"

[requires]
python_version = "3.9"

[scripts]
extract-openapi = "python backend/extract-openapi.py app.main:app"
231 changes: 101 additions & 130 deletions Pipfile.lock

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![](docs/source/img/logo_full.png)
![](docs/source/img/logo_full.png)

# Clowder v2 (In active development)
[![Build Status](https://github.com/clowder-framework/clowder2/actions/workflows/pytest.yml/badge.svg?branch=main)](https://github.com/clowder-framework/clowder2/actions?query=branch%3Amain)
Expand All @@ -9,8 +9,8 @@
*For the previous version of Clowder, please see [Clowder v1](https://github.com/clowder-framework/clowder).*

Clowder v2 is a reimagining of the [Clowder research data management system](https://clowderframework.org/)
using a different and newer technology stack. Clowder is a cloud native data management framework to support any
research domain. Clowder was developed to help researchers and scientists in data intensive domains manage raw data,
using a different and newer technology stack. Clowder is a cloud native data management framework to support any
research domain. Clowder was developed to help researchers and scientists in data intensive domains manage raw data,
complex metadata, and automatic data pipelines.

While the Clowder v1 has worked well over the years, many of the underlying
Expand All @@ -31,36 +31,36 @@ The v2 documentation is still work in progress. It's available at https://clowde

The v1 documentation is not fully compatible with v2, but it does provide some still relevant information.
It is available at https://clowder-framework.readthedocs.io.
There is a few other documentation links available on the [website](https://clowderframework.org/documentation.html).
There is a few other documentation links available on the [website](https://clowderframework.org/documentation.html).

## Installation

The easiest way of running Clowder v2 is checking out the [code](https://github.com/clowder-framework/clowder2)
The easiest way of running Clowder v2 is checking out the [code](https://github.com/clowder-framework/clowder2)
and running `docker compose up` in the main directory.

Helm charts are available for running Clowder v2 on Kubernetes. See the [helm](https://github.com/clowder-framework/clowder2/tree/main/deployments/kubernetes/charts) directory for more information.

## Contributing

We are always looking for contributors. This could be anything from fixing bugs, adding new features, providing new
feature requests, reccomending UI/UX improvements, helping with the documentation, or just testing the system and
We are always looking for contributors. This could be anything from fixing bugs, adding new features, providing new
feature requests, reccomending UI/UX improvements, helping with the documentation, or just testing the system and
providing feedback. Here are a few ways to get started:

- Join our [Slack](https://join.slack.com/t/clowder-software/shared_invite/zt-4e0vo0sh-YNndJEuLtPGRa7~uIlpcNA)
- Join our [Slack](https://join.slack.com/t/clowder-software/shared_invite/zt-4e0vo0sh-YNndJEuLtPGRa7~uIlpcNA)
channel, introduce yourself, and ask questions about the specific aspects of the system you are interested in.
- Submit an issue (bug or feature request) on the [issue tracker](https://github.com/clowder-framework/clowder2/issues).
- Submit a [pull request](https://github.com/clowder-framework/clowder2/pulls) with a bug fix or new feature. For
- Submit a [pull request](https://github.com/clowder-framework/clowder2/pulls) with a bug fix or new feature. For
larger changes, it's best to open an issue first or ask on Slack to discuss the changes.
- Develop new [information extractors](https://github.com/clowder-framework/pyclowder) and/or visualizations.

Please follow our [code of conduct](https://github.com/clowder-framework/clowder/blob/develop/CODE_OF_CONDUCT.md) when
Please follow our [code of conduct](https://github.com/clowder-framework/clowder/blob/develop/CODE_OF_CONDUCT.md) when
interacting with the community.

## Support & Contacts

The easiest way to get in touch with us is [Slack](https://join.slack.com/t/clowder-software/shared_invite/zt-4e0vo0sh-YNndJEuLtPGRa7~uIlpcNA).
This is a public forum. If you prefer email, you can contact us at [[email protected]](mailto:[email protected]).
This is a public forum. If you prefer email, you can contact us at [[email protected]](mailto:[email protected]).

## License

Clowder v2 is licensed under the [Apache 2.0 license](https://github.com/clowder-framework/clowder2/blob/main/LICENSE).
Clowder v2 is licensed under the [Apache 2.0 license](https://github.com/clowder-framework/clowder2/blob/main/LICENSE).
6 changes: 6 additions & 0 deletions backend/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ rocrate = "0.7.0"
httpx = "0.24.0"
packaging = "23.1"
itsdangerous = "2.1.2"
flake8 = "*"
pyflakes = "*"
autoflake = "*"
isort = "*"
shellcheck-py = "*"
pre-commit = "*"

[dev-packages]
requests = "2.28.2"
Expand Down
Loading
Loading