Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 4 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,15 @@ Inside of `desktop-cmu-graphics` you will find the following...
There are a number of dependencies that need to be installed:

cd <path/to/desktop-cmu-graphics>
python -m venv venv
.\venv\Scripts\activate (if on Windows)
source venv/bin/activate (otherwise)
pip install twine build tox pre-commit
pre-commit install
uv run pre-commit install --install-hooks


# Running a Build

To build the installer zip file, run...

```
python build/build.py
uv run build/build.py
```

# Testing
Expand All @@ -54,22 +50,19 @@ Before creating a new pull request, you should run the test suite to make sure y
## Setup for Testing

- Build the library as described above in "Running a Build"
- Install testing dependencies:

pip install psutil pillow imageio numpy

## Running the test cases

Run tox:

```
tox
uv run tox
```

This will run the tests using a bunch of different versions of python. The tests will fail for particular "environments" if you don't have the necessary version of python already installed. After running tox once for all environments, you can run it for just a single environment so that it is much faster. Pick an environment that succeeded the first time, e.g. `py310-pip` and pass that to tox:

```
tox -e py310-pip
uv run tox -e py310-pip
```

## Using the test output
Expand Down
7 changes: 6 additions & 1 deletion build/splitversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ def split_versions(zip_dest, pypi_dest, dots):
print(f"Copying cmu_graphics package to {zip_dest} ...")
shutil.copytree(dots + "cmu_graphics", dots + f"{zip_dest}/cmu_graphics")

print(f"Copying cmu_cpcs_utils to {pypi_dest} ...")
shutil.copy(dots + "cmu_cpcs_utils.py", dots + f"{pypi_dest}/")
print(f"Copying cmu_cpcs_utils to {zip_dest} ...")
shutil.copy(dots + "cmu_cpcs_utils.py", dots + f"{zip_dest}/")

print(f"Copying sample files to {pypi_dest}/cmu_graphics ...")
shutil.copytree(dots + "samples", dots + f"{pypi_dest}/cmu_graphics/samples")
print(f"Copying sample files to {zip_dest} ...")
Expand All @@ -47,7 +52,7 @@ def split_versions(zip_dest, pypi_dest, dots):
# Meta files and docs
for path in ["LICENSE", "INSTRUCTIONS.pdf"]:
shutil.copy2(dots + path, dots + f"{zip_dest}/{os.path.basename(path)}")
for path in ["LICENSE", "README.md", "setup.py", "pyproject.toml"]:
for path in ["LICENSE", "README.md", "pyproject.toml"]:
shutil.copy2(dots + path, dots + f"{pypi_dest}/{os.path.basename(path)}")

apply_regex_to_dirs([
Expand Down
Loading