{"id":23799780,"url":"https://github.com/python-discord/code-jam-template","last_synced_at":"2025-10-30T13:07:26.434Z","repository":{"id":46901886,"uuid":"384451931","full_name":"python-discord/code-jam-template","owner":"python-discord","description":"Template repository for Python Discord Code Jam projects.","archived":false,"fork":false,"pushed_at":"2024-07-07T06:53:25.000Z","size":33,"stargazers_count":8,"open_issues_count":0,"forks_count":12,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-01-01T21:27:26.955Z","etag":null,"topics":["code-jam","python-discord","python-template","template"],"latest_commit_sha":null,"homepage":"https://pythondiscord.com/events/code-jams/","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/python-discord.png","metadata":{"funding":{"patreon":"python_discord","custom":"https://www.redbubble.com/people/pythondiscord"},"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-09T13:52:37.000Z","updated_at":"2024-07-22T15:29:34.000Z","dependencies_parsed_at":"2024-07-07T07:47:39.920Z","dependency_job_id":"2d538170-6a69-485c-920c-47abeb4a1f89","html_url":"https://github.com/python-discord/code-jam-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-discord%2Fcode-jam-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-discord%2Fcode-jam-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-discord%2Fcode-jam-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-discord%2Fcode-jam-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/python-discord","download_url":"https://codeload.github.com/python-discord/code-jam-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240040484,"owners_count":19738555,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-jam","python-discord","python-template","template"],"created_at":"2025-01-01T21:27:20.537Z","updated_at":"2025-10-30T13:07:26.427Z","avatar_url":"https://github.com/python-discord.png","language":null,"funding_links":["https://patreon.com/python_discord","https://www.redbubble.com/people/pythondiscord"],"categories":[],"sub_categories":[],"readme":"# Python Discord Code Jam Repository Template\n\n## A primer\n\nHello code jam participants! We've put together this repository template for you to use in [our code jams](https://pythondiscord.com/events/) or even other Python events!\n\nThis document contains the following information:\n\n1. [What does this template contain?](#what-does-this-template-contain)\n2. [How do I use this template?](#how-do-i-use-this-template)\n3. [How do I adapt this template to my project?](#how-do-i-adapt-this-template-to-my-project)\n\n\u003e [!TIP]\n\u003e You can also look at [our style guide](https://pythondiscord.com/events/code-jams/code-style-guide/) to get more information about what we consider a maintainable code style.\n\n## What does this template contain?\n\nHere is a quick rundown of what each file in this repository contains:\n\n- [`LICENSE.txt`](LICENSE.txt): [The MIT License](https://opensource.org/licenses/MIT), an OSS approved license which grants rights to everyone to use and modify your project, and limits your liability. We highly recommend you to read the license.\n- [`.gitignore`](.gitignore): A list of files and directories that will be ignored by Git. Most of them are auto-generated or contain data that you wouldn't want to share publicly.\n- [`pyproject.toml`](pyproject.toml): Configuration and metadata for the project, as well as the linting tool Ruff. If you're interested, you can read more about `pyproject.toml` in the [Python Packaging documentation](https://packaging.python.org/en/latest/guides/writing-pyproject-toml/).\n- [`.pre-commit-config.yaml`](.pre-commit-config.yaml): The configuration of the [pre-commit](https://pre-commit.com/) tool.\n- [`.github/workflows/lint.yaml`](.github/workflows/lint.yaml): A [GitHub Actions](https://github.com/features/actions) workflow, a set of actions run by GitHub on their server after each push, to ensure the style requirements are met.\n\nEach of these files have comments for you to understand easily, and modify to fit your needs.\n\n### Ruff: general style rules\n\nOur first tool is Ruff. It will check your codebase and warn you about any non-conforming lines.\nIt is run with the command `ruff check` in the project root.\n\nHere is a sample output:\n\n```shell\n$ ruff check\napp.py:1:5: N802 Function name `helloWorld` should be lowercase\napp.py:1:5: ANN201 Missing return type annotation for public function `helloWorld`\napp.py:2:5: D400 First line should end with a period\napp.py:2:5: D403 First word of the first line should be capitalized: `docstring` -\u003e `Docstring`\napp.py:3:15: W292 No newline at end of file\nFound 5 errors.\n```\n\nEach line corresponds to an error. The first part is the file path, then the line number, and the column index.\nThen comes the error code, a unique identifier of the error, and then a human-readable message.\n\nIf, for any reason, you do not wish to comply with this specific error on a specific line, you can add `# noqa: CODE` at the end of the line.\nFor example:\n\n```python\ndef helloWorld():  # noqa: N802\n    ...\n\n```\n\nThis will ignore the function naming issue and pass linting.\n\n\u003e [!WARNING]\n\u003e We do not recommend ignoring errors unless you have a good reason to do so.\n\n### Ruff: formatting\n\nRuff also comes with a formatter, which can be run with the command `ruff format`.\nIt follows the same code style enforced by [Black](https://black.readthedocs.io/en/stable/index.html), so there's no need to pick between them.\n\n### Pre-commit: run linting before committing\n\nThe second tool doesn't check your code, but rather makes sure that you actually *do* check it.\n\nIt makes use of a feature called [Git hooks](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks) which allow you to run a piece of code before running `git commit`.\nThe good thing about it is that it will cancel your commit if the lint doesn't pass. You won't have to wait for GitHub Actions to report issues and have a second fix commit.\n\nIt is *installed* by running `pre-commit install` and can be run manually by calling only `pre-commit`.\n\n[Lint before you push!](https://soundcloud.com/lemonsaurusrex/lint-before-you-push)\n\n#### List of hooks\n\n- `check-toml`: Lints and corrects your TOML files.\n- `check-yaml`: Lints and corrects your YAML files.\n- `end-of-file-fixer`: Makes sure you always have an empty line at the end of your file.\n- `trailing-whitespace`: Removes whitespaces at the end of each line.\n- `ruff-check`: Runs the Ruff linter.\n- `ruff-format`: Runs the Ruff formatter.\n\n## How do I use this template?\n\n### Creating your team repository\n\nOne person in the team, preferably the leader, will have to create the repository and add other members as collaborators.\n\n1. In the top right corner of your screen, where **Clone** usually is, you have a **Use this template** button to click.\n   ![use-this-template-button](https://docs.github.com/assets/images/help/repository/use-this-template-button.png)\n2. Give the repository a name and a description.\n   ![create-repository-name](https://docs.github.com/assets/images/help/repository/create-repository-name.png)\n3. Click **Create repository from template**.\n4. Click **Settings** in your newly created repository.\n   ![repo-actions-settings](https://docs.github.com/assets/images/help/repository/repo-actions-settings.png)\n5. In the \"Access\" section of the sidebar, click **Collaborators**.\n   ![collaborators-settings](https://github.com/python-discord/code-jam-template/assets/63936253/c150110e-d1b5-4e4d-93e0-0a2cf1de352b)\n6. Click **Add people**.\n7. Insert the names of each of your teammates, and invite them. Once they have accepted the invitation in their email, they will have write access to the repository.\n\nYou are now ready to go! Sit down, relax, and wait for the kickstart!\n\n\u003e [!IMPORTANT]\n\u003e Don't forget to change the project name, description, and authors at the top of the [`pyproject.toml`](pyproject.toml) file, and swap \"Python Discord\" in the [`LICENSE.txt`](LICENSE.txt) file for the name of each of your team members or the name of your team *after* the start of the code jam.\n\n### Using the default pip setup\n\nOur default setup includes a dependency group to be used with a [virtual environment](https://docs.python.org/3/library/venv.html).\nIt works with pip and uv, and we recommend this if you have never used any other dependency manager, although if you have, feel free to switch to it.\nMore on that [below](#how-do-i-adapt-this-template-to-my-project).\n\nDependency groups are a relatively new feature, specified in [PEP 735](https://peps.python.org/pep-0735/).\nYou can read more about them in the [Python Packaging User Guide](https://packaging.python.org/en/latest/specifications/dependency-groups/).\n\n#### Creating the environment\n\nCreate a virtual environment in the folder `.venv`.\n\n```shell\npython -m venv .venv\n```\n\n#### Entering the environment\n\nIt will change based on your operating system and shell.\n\n```shell\n# Linux, Bash\n$ source .venv/bin/activate\n# Linux, Fish\n$ source .venv/bin/activate.fish\n# Linux, Csh\n$ source .venv/bin/activate.csh\n# Linux, PowerShell Core\n$ .venv/bin/Activate.ps1\n# Windows, cmd.exe\n\u003e .venv\\Scripts\\activate.bat\n# Windows, PowerShell\n\u003e .venv\\Scripts\\Activate.ps1\n```\n\n#### Installing the dependencies\n\nOnce the environment is created and activated, use this command to install the development dependencies.\n\n```shell\npip install --group dev\n```\n\n#### Exiting the environment\n\nInterestingly enough, it is the same for every platform.\n\n```shell\ndeactivate\n```\n\nOnce the environment is activated, all the commands listed previously should work.\n\n\u003e [!IMPORTANT]\n\u003e We highly recommend that you run `pre-commit install` as soon as possible.\n\n## How do I adapt this template to my project?\n\nIf you wish to use Pipenv or Poetry, you will have to move the dependencies in [`pyproject.toml`](pyproject.toml) to the development dependencies of your tool.\n\nWe've included a porting to both [Poetry](samples/pyproject.toml) and [Pipenv](samples/Pipfile) in the [`samples` folder](samples).\nNote that the Poetry [`pyproject.toml`](samples/pyproject.toml) file does not include the Ruff configuration, so if you simply replace the file then the Ruff configuration will be lost.\n\nWhen installing new dependencies, don't forget to [pin](https://pip.pypa.io/en/stable/topics/repeatable-installs/#pinning-the-package-versions) them by adding a version tag at the end.\nFor example, if I wish to install [Click](https://click.palletsprojects.com/en/8.1.x/), a quick look at [PyPI](https://pypi.org/project/click/) tells me that `8.1.7` is the latest version.\nI will then add `click~=8.1`, without the last number, to my requirements file or dependency manager.\n\n\u003e [!IMPORTANT]\n\u003e A code jam project is left unmaintained after the end of the event. If the dependencies aren't pinned, the project will break after any major change in an API.\n\n## Final words\n\n\u003e [!IMPORTANT]\n\u003e Don't forget to replace this README with an actual description of your project! Images are also welcome!\n\nWe hope this template will be helpful. Good luck in the jam!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpython-discord%2Fcode-jam-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpython-discord%2Fcode-jam-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpython-discord%2Fcode-jam-template/lists"}