diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index e5b3c448..0d3ec1d5 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -14,7 +14,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ['3.10', '3.11', '3.12', '3.13'] + python-version: ["3.10", "3.11", "3.12", "3.13"] steps: - name: Check out repository @@ -29,7 +29,7 @@ jobs: working-directory: canvas_editor run: | python -m pip install --upgrade pip - pip install -r requirements.txt + python -m pip install -e ".[dev]" - name: Run Tests working-directory: canvas_editor @@ -86,6 +86,6 @@ jobs: coverage xml - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # release v5.5.1 + uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # release v5.5.1 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2510c059..b99858eb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,9 +8,12 @@ By participating, you can help improve the project and make it even better :rais 1. **Fork the Repository**: Click the "Fork" button at the top right corner of this repository's page to create your own copy. 2. **Clone Your Fork**: Clone your forked repository to your local machine using Git :octocat:: + ```bash git clone https://github.com/ARTIST-Association/CANVAS.git `` + ``` + 3. **Install all development dependencies** in a separate python virtual environment from the main branch of your repo. This will put a number of pre-commit hooks, for code linting and code style for both Python and JavaScript, into place. It will also install tools like ruff and ESLint, used for development. @@ -21,17 +24,20 @@ By participating, you can help improve the project and make it even better :rais python3 -m venv source + # Dev tools + cd CANVAS/canvas_editor/ + python -m pip install -e ".[dev]" + # Pre commit hooks pre-commit install - # Dev tools - cd canvas_editor/ - python -m pip install -r requirements.txt + # Install all JavaScript dev dependencies npm install ``` 4. **Create a Branch**: Create a new branch for your contribution. Choose a descriptive name. Depending on what you want to work on, prepend either of the following prefixes, `features`, `maintenance`, `bugfix`, or `hotfix`. Example: + ```bash git checkout -b features/your-feature-name ``` @@ -145,11 +151,11 @@ By participating, you can help improve the project and make it even better :rais As the remote branch is already linked - 8. **Rebase Onto Current Main:** Rebase your feature branch onto the current main branch of the original repo. This will include any changes that might have been pushed into the main in the meantime and resolve possible conflicts. To sync your fork with the original upstream repo, check out [this page](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork) or follow the steps below. Note that before you can sync your fork with an upstream repo, you must configure a remote that points to the upstream repository in Git. + ``` cd git fetch upstream @@ -160,7 +166,6 @@ By participating, you can help improve the project and make it even better :rais 9. **Open a Pull Request**: Go to the [original repository](https://github.com/ARTIST-Association/CANVAS.git) and click the "New Pull Request" button. Follow the guidelines in the template to submit your pull request. - ## Code of Conduct Please note that we have a [Code of Conduct](CODE_OF_CONDUCT.md), and we expect all contributors to follow it. Be kind and respectful to one another :blue_heart:. diff --git a/README.md b/README.md index 2e388d7a..1dbaa9f0 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,8 @@ We heavily recommend to install `CANVAS` package in a dedicated `Python3.10+` virtual environment ([click here for the documentation](https://docs.python.org/3/library/venv.html)). -After setting up and activating the virtual environment _(or deciding against it)_, execute the following instructions, to set up the code base +After setting up and activating the virtual environment _(or deciding against it)_, execute the following instructions, start the server. +See [CONTRIBUTING.md](/CONTRIBUTING.md) on how to set up a development environment. ```bash # You may have to replace python with python3, depending on your operating system. @@ -22,22 +23,15 @@ After setting up and activating the virtual environment _(or deciding against it git clone https://github.com/ARTIST-Association/CANVAS.git # install requirements -cd CANVAS-PSE2425/ -pip install -r requirements.txt - -# Installing Pre-commit Hooks -pre-commit install +cd CANVAS/canvas_editor/ +pip install . # add the .env file to the root of the canvas_editor folder # containing debug variable, client_id + secret_key for OpenID, email-host password, etc. # configure the database -cd canvas_editor/ python manage.py migrate -# Install npm dependencies -npm install - # start the server python manage.py runserver diff --git a/canvas_editor/pyproject.toml b/canvas_editor/pyproject.toml index 1f9f6738..acdc8008 100644 --- a/canvas_editor/pyproject.toml +++ b/canvas_editor/pyproject.toml @@ -5,35 +5,70 @@ description = "An web-based 3D editor for ARTIST" readme = "README.md" requires-python = ">=3.10" + +dependencies = [ + "django==5.2.8", + "djangorestframework==3.16.1", + "artist-csp==1.0.0", + "django-cleanup==9.0.0", + "django-allauth==65.13.1", + "python-dotenv==1.2.1", + "Pillow==12.0.0", + "jwt==1.4.0", +] + + +[project.optional-dependencies] +dev = [ + "coverage==7.12.0", + "pre-commit==4.5.0", + "mypy==1.18.2", + "ruff==0.14.6", + "parameterized==0.9.0", + "unittest-xml-reporting==3.2.0", +] + + +[tool.setuptools.packages.find] +include = [ + "account_management", + "autosave_api", + "canvas", + "editor", + "hdf_management", + "job_interface", + "project_management", +] + [tool.ruff] # Exclude a variety of commonly ignored directories. exclude = [ - ".bzr", - ".direnv", - ".eggs", - ".git", - ".git-rewrite", - ".hg", - ".ipynb_checkpoints", - ".mypy_cache", - ".nox", - ".pants.d", - ".pyenv", - ".pytest_cache", - ".pytype", - ".ruff_cache", - ".svn", - ".tox", - ".venv", - ".vscode", - "__pypackages__", - "_build", - "buck-out", - "build", - "dist", - "node_modules", - "site-packages", - "venv", + ".bzr", + ".direnv", + ".eggs", + ".git", + ".git-rewrite", + ".hg", + ".ipynb_checkpoints", + ".mypy_cache", + ".nox", + ".pants.d", + ".pyenv", + ".pytest_cache", + ".pytype", + ".ruff_cache", + ".svn", + ".tox", + ".venv", + ".vscode", + "__pypackages__", + "_build", + "buck-out", + "build", + "dist", + "node_modules", + "site-packages", + "venv", ] line-length = 120 diff --git a/canvas_editor/requirements.txt b/canvas_editor/requirements.txt deleted file mode 100644 index df526446..00000000 --- a/canvas_editor/requirements.txt +++ /dev/null @@ -1,17 +0,0 @@ -django -djangorestframework -git+https://github.com/ARTIST-Association/ARTIST.git -torch -django-cleanup -django-allauth -requests -PyJWT -python-dotenv -cryptography -Pillow -coverage -mypy -pre-commit -ruff -parameterized -unittest-xml-reporting