{"id":18927434,"url":"https://github.com/pygame/pygameweb","last_synced_at":"2025-05-16T15:07:50.468Z","repository":{"id":18531651,"uuid":"81622842","full_name":"pygame/pygameweb","owner":"pygame","description":"🎮🕸️ pygame.org website. Python, PostgreSQL, Flask, sqlalchemy, JS.","archived":false,"fork":false,"pushed_at":"2024-12-23T21:18:15.000Z","size":503,"stargazers_count":123,"open_issues_count":62,"forks_count":35,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-05-14T21:54:33.512Z","etag":null,"topics":["flask","pygame","python","sqlalchemy"],"latest_commit_sha":null,"homepage":"https://www.pygame.org/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pygame.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2017-02-11T01:40:39.000Z","updated_at":"2025-02-18T18:44:05.000Z","dependencies_parsed_at":"2023-09-23T20:08:34.189Z","dependency_job_id":"7ae0c55c-2ceb-47bb-904d-5579522900d7","html_url":"https://github.com/pygame/pygameweb","commit_stats":{"total_commits":329,"total_committers":11,"mean_commits":29.90909090909091,"dds":"0.10030395136778114","last_synced_commit":"8d02d1bbbe27a3611e88baf48fcea3d0d56d994c"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pygame%2Fpygameweb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pygame%2Fpygameweb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pygame%2Fpygameweb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pygame%2Fpygameweb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pygame","download_url":"https://codeload.github.com/pygame/pygameweb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254553958,"owners_count":22090417,"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":["flask","pygame","python","sqlalchemy"],"created_at":"2024-11-08T11:19:10.385Z","updated_at":"2025-05-16T15:07:45.452Z","avatar_url":"https://github.com/pygame.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"pygame.org website |coverage-status|\n====================================\n\nPieces of the pygame website (https://www.pygame.org/) will be open sourced here.\n\nStrategy is to bring in code one piece at a time, and clean it up as I go.\n\n\nIt's a community website where people can post projects, comment on them,\nbut also write things in there themselves on wiki pages.\n\n\nQuick-Start\n===========\n\nSet up the required packages::\n\n    python3.6 -m venv anenv\n    . ./anenv/bin/activate\n    pip install --upgrade pip\n    pip install -r requirements.dev.txt\n    pip install -e .\n\nFor now yuicompressor is needed for css compression, and\nimagamagick and optipng are needed for creating and optimizing image thumbnails,\nadditionally postgresql is the database of choice::\n    brew install yuicompressor node optipng imagemagick postgresql\n    sudo apt-get install yui-compressor nodejs optipng imagemagick postgresql postgresql-client libpq-dev\n\n\nEnvironment setup\n=================\n\nDefine a **.env** file based on the **example.env** file.\n\n::\n\n    cp example.env .env\n\nDefine the **APP_SECRET_KEY** variable in the **.env** file or the tests won't work. \nYou can define any value, like **\"a\"** or **\"s3cret-stuff-blah\"**.\n\nTool setup\n==========\n\nSee setup.cfg for all tool config (pytest, coverage, etc).\n\n\n\nDb setup instructions\n=====================\n\npostgresql 9.6\n\nOne database for testing, and another one for running the app.\n\nWe use alembic for db migrations. http://alembic.readthedocs.org/en/latest/\n\n\nSet up the `postgresql` database::\n\n    sudo -u postgres createdb pygame\n    sudo -u postgres psql pygame -c \"CREATE USER pygame WITH PASSWORD 'password';\"\n    sudo -u postgres psql pygame -c \"GRANT ALL PRIVILEGES ON DATABASE pygame to pygame;\"\n\nWe also create a database for running tests::\n\n    sudo -u postgres createdb pygame_test\n    sudo -u postgres psql pygame -c \"CREATE USER pygame_test WITH PASSWORD 'password';\"\n    sudo -u postgres psql pygame_test -c \"GRANT ALL PRIVILEGES ON DATABASE pygame_test to pygame_test;\"\n\n\nTo upgrade to latest model changes do::\n\n    alembic upgrade head\n\n\nWhen you change a model make an alembic revision::\n\n    alembic revision --autogenerate -m \"Added a field for these reasons.\"\n\nThen you will need to apply the change to your db (and commit the version file)::\n\n    alembic upgrade head\n\n\nTesting with pytest\n===================\n\nhttp://docs.pytest.org/en/latest/\n\nTo run all unit tests and functional tests use::\n\n    pytest\n\nTo watch for changes and rerun tests::\n\n    ptw\n\nMaybe you just want to test the wiki parts::\n\n    pytest -k wiki\n\n\ntests/unit/ are for unit tests.\ntests/functional/ are for tests which would use flask and db.\ntests/conftest.py is for test configuration.\ntests/sqlpytestflask.py are some fixtures for db testing.\n\nUnit tests and functional tests are kept separate, because functional tests can take a while longer to run.\n\nWe use various fixtures to make writing the tests easier and faster.\n\n\nRunning the webserver locally\n=============================\n\nUse an environment variable to configure the database connection (see the\ndatabase setup steps above)::\n\n    export APP_DATABASE_URL=\"postgresql://pygame:password@localhost/pygame\"\n\nConfigure a directory containing static files::\n\n    export APP_WWW=\"static/\"\n\nThe application may need a secure key, but for debugging it's not important\nthat it's properly random::\n\n    export APP_SECRET_KEY=\"s3cret-stuff-blah\"\n\nFinally, you can enable some Flask debugging machinery (which should be off for\nthe site in production)::\n\n    export APP_DEBUG=1\n\nNow add the database fixtures to populate it with sample users. After that, you should be able to\nlogin as admin with email ``admin@example.com`` and  password ``password``::\n    \n    pygameweb_fixtures\n    \nThen run::\n\n    pygameweb_front\n\n\nTemplates with jinja2 and bootstrap\n===================================\n\npygameweb/templates/\n\nWe use::\n\n    * `Jinja2 \u003chttp://jinja.pocoo.org/\u003e`_\n    * `Flask-Bootstrap \u003chttps://pythonhosted.org/Flask-Bootstrap/basic-usage.html\u003e`_\n    * `Bootstrap \u003chttp://getbootstrap.com/\u003e`_\n\n\nCommand line tools with click\n=============================\n\nWe use click and setuptools entry points (in setup.py) for command line tools::\n\n    * `click \u003chttp://click.pocoo.org/5/\u003e`_\n    * `entry points \u003chttps://packaging.python.org/distributing/#entry-points\u003e`_\n\nNote, when you add or change a command line tool, you need to `pip install -e .` again.\n\nIf you can, try not to use command line options at all. Have one command do one thing,\nand make the defaults good, or use the pygameweb.config.\n\n\nUser login with Flask-security-fork\n===================================\n\npygameweb.user\npygameweb/templates/security\n\nUsing::\n\n    * `flask-security-fork \u003chttps://flask-security-fork.readthedocs.io/en/latest/quickstart.html\u003e`_\n\n\nNavigation with flask-nav\n=========================\n\npygameweb.nav\npygameweb.page.models\n\nUsing::\n\n    * `flask-nav \u003chttp://pythonhosted.org/flask-nav/\u003e`_\n    * `flask-bootstrap \u003chttps://pythonhosted.org/Flask-Bootstrap/nav.html\u003e`_\n\n\n\nDashboard is an overview\n========================\n\nof all sorts of things happening in the pygame worlds around the interwebs.\n\nhttps://pygame.org/dashboard\n\nIt's a 7000px wide webpage offering a summary of what's happening.\n\nProjects people are working on,\nvideos folks are making,\ntweets twits are... tweeting,\nquestions asked and answered.\n\n\n\nTo caching things we\n====================\n\nuse `Flask-Caching \u003chttp://pythonhosted.org/Flask-Caching/\u003e`_\n\npygameweb.cache\npygameweb.news.views\n\n\nWith with a @cache decorator, and/or markup in a template.\n\n\n.. |coverage-status| image:: https://coveralls.io/repos/github/pygame/pygameweb/badge.svg?branch=main\n   :target: https://coveralls.io/github/pygame/pygameweb?branch=main\n   :alt: Test coverage percentage\n\n\n\nReleases\n========\n\nStep by step release instructions below.\n\n- Commits to `main` branch do a dev deploy to pypi.\n- Commits to `maintest` branch do a dev deploy to pypi.\n- Commits to a tag do a real deploy to pypi.\n\n\nPrereleases\n-----------\n\nhttps://packaging.python.org/tutorials/distributing-packages/#pre-release-versioning\n\nPre releases should be named like this:\n```\n# pygameweb/__init__.py\n__version__ = '0.0.2'\n```\nWhich is one version ahead of of the last tagged release.\n\nRelease tags should be like '0.0.2', and match the `pygameweb/__init__.py __version__`.\n\n\nPreparing a release in a branch.\n--------------------------------\n\nIt's a good idea to start a branch first, and make any necessary changes\nfor the release.\n\n```\ngit checkout -b v0.0.2\nvi pygameweb/__init__.py __version__ = '0.0.2'\ngit commit -m \"Version 0.0.2\"\n```\n\nChange log, drafting a release.\n-------------------------------\n\nGithub 'releases' are done as well.\nYou can start drafting the release notes in there before the tag.\nhttps://help.github.com/articles/creating-releases/\n\nYou can make the release notes with the help of the changes since last release.\nhttps://github.com/pygame/pygameweb/compare/0.0.1...main\n\ngit log 0.0.1...main\n\nTagging a release\n-----------------\n\nWhen the release is tagged, pushing it starts the deploy to pypi off.\n```\ngit tag -a 0.0.2\ngit push origin 0.0.2\n```\nNote: do not tag pre releases\n(these are made on commits to `main`/`maintest`).\n\nAfter the tag is pushed, then you can do the release\nin github from your draft release.\n\n\nBack to dev version.\n--------------------\n\nIf we were at 0.0.2 before, now we want to be at 0.0.3.dev\n```\nvi pygameweb/__init__.py __version__ = '0.0.3.dev'\n```\n\nMerge the release branch into main, and push that up.\n\n\nContributing\n============\n\nPlease discuss contributions first to avoid disappointment and rework.\n\nPlease see `contribution-guide.org \u003chttp://www.contribution-guide.org/\u003e`_ and\n`Python Code of Conduct \u003chttps://www.python.org/psf/codeofconduct/\u003e`_ for\ndetails on what we expect from contributors. Thanks!\n\nThe stack? python 3.6, postgresql 9.6, Flask, py.test, sqlalchemy, alembic, gulp, ansible, node.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpygame%2Fpygameweb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpygame%2Fpygameweb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpygame%2Fpygameweb/lists"}