All Projects â†’ pygame â†’ pygameweb

pygame / pygameweb

Licence: BSD-2-Clause license
🎮🕸️ pygame.org website. Python, PostgreSQL, Flask, sqlalchemy, JS.

Programming Languages

python
139335 projects - #7 most used programming language
HTML
75241 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to pygameweb

Wario-Land-3
A remake of the GBC-Game "Wario Land 3" using Pygame for Python
Stars: ✭ 48 (-48.94%)
Mutual labels:  pygame
Pycraft
Pycraft is the OpenGL, open world, video game made entirely with Python. This project is a game to shed some light on OpenGL programming in Python as it is a seldom touched area of Python's vast amount of uses. Feel free to give this project a run, and message us if you have any feedback!
Stars: ✭ 39 (-58.51%)
Mutual labels:  pygame
COVID-Resource-Allocation-Simulator
Agent-based modelling for resource allocation in viral crises to investigate resource allocation and policy interventions with respect to transmission rate.
Stars: ✭ 61 (-35.11%)
Mutual labels:  pygame
RealTime-DigitRecognition
RealTime DigitRecognition using Convolutional Neural Network(CNN) with keras.
Stars: ✭ 108 (+14.89%)
Mutual labels:  pygame
Fegaria-Remastered
Similar to my other project Fegaria, but with improved graphics, collisions and terrain generation.
Stars: ✭ 73 (-22.34%)
Mutual labels:  pygame
DungeonGenerator
Procedural Dungeon Generation with Python and Pygame
Stars: ✭ 57 (-39.36%)
Mutual labels:  pygame
Python.io
Snake game inspired from Slither.io but features a python instead of a snake. Made in Python 3
Stars: ✭ 15 (-84.04%)
Mutual labels:  pygame
raylib-py
A Python binding for the great C library raylib.
Stars: ✭ 147 (+56.38%)
Mutual labels:  pygame
sqlalchemy-citext
CITEXT type for SQLAlchemy
Stars: ✭ 26 (-72.34%)
Mutual labels:  sqlalchemy
mara-db
Lightweight configuration and access to multiple databases in a single project
Stars: ✭ 36 (-61.7%)
Mutual labels:  sqlalchemy
flask-restalchemy
Flask extension to build REST APIs based on SQLAlchemy models
Stars: ✭ 34 (-63.83%)
Mutual labels:  sqlalchemy
d2a
A translator Django into SQLAlchemy.
Stars: ✭ 23 (-75.53%)
Mutual labels:  sqlalchemy
tutorials
Collection of tutorials for various libraries and technologies
Stars: ✭ 98 (+4.26%)
Mutual labels:  sqlalchemy
Snake-Game-with-Deep-learning
Developing a neural network to play a snake game
Stars: ✭ 43 (-54.26%)
Mutual labels:  pygame
PlaneWars
微信飞机大战 python pygame
Stars: ✭ 22 (-76.6%)
Mutual labels:  pygame
flask for startups
Flask boilerplate using a services oriented structure
Stars: ✭ 210 (+123.4%)
Mutual labels:  sqlalchemy
futaba
Discord bot for the Programming server
Stars: ✭ 22 (-76.6%)
Mutual labels:  sqlalchemy
django-sqlalchemy
Django ORM built on top of SQLalchemy core 2.0 for seamless integration of SQLAlchemy with Django 4.1+ PostgreSQL 14+ only for now. [pre POC now]
Stars: ✭ 101 (+7.45%)
Mutual labels:  sqlalchemy
Conway-s-Game-of-life---Python
Conways game of life with pygame
Stars: ✭ 26 (-72.34%)
Mutual labels:  pygame
flask-tweeeter
A full-stack Twitter clone made using the Flask framework for Python 🐦
Stars: ✭ 28 (-70.21%)
Mutual labels:  sqlalchemy

pygame.org website Build status Test coverage percentage

Pieces of the pygame website (https://www.pygame.org/) will be open sourced here.

Strategy is to bring in code one piece at a time, and clean it up as I go.

It's a community website where people can post projects, comment on them, but also write things in there themselves on wiki pages.

Contributing

Please discuss contributions first to avoid disapointment and rework.

Please see contribution-guide.org and Python Code of Conduct for details on what we expect from contributors. Thanks!

The stack is something like: python 3.6, postgresql 9.6, Flask, py.test, sqlalchemy, alembic, gulp, ansible, node.

Quickstart

Set up the required packages:

python3.6 -m venv anenv
. ./anenv/bin/activate
pip install --upgrade pip
pip install -r requirements.dev.txt
pip install -e .

If you would get some error related to pip's conflic checker update after execute pip install -r requirements.dev.txt, add the flag --use-feature=2020-resolver to the end of the command.

For now yuicompressor is needed for css compression, and imagamagick and optipng are needed for creating and optimizing image thumbnails:

brew install yuicompressor node optipng imagemagick
apt-get install yui-compressor nodejs optipng imagemagick

Environment setup

Define a .env file based on the example.env file.

cp example.env .env

If you get some errors while executing the tests, just define the APP_SECRET_KEY variable on the .env file. You can define any value, like "a" or "s3cret-stuff-blah".

Tool setup

See setup.cfg for all tool config (pytest, coverage, etc).

Db setup instructions

postgresql 9.6

One database for testing, and another one for running the app.

We use alembic for db migrations. http://alembic.readthedocs.org/en/latest/

Set up the postgresql database:

createdb pygame
psql pygame -c "CREATE USER pygame WITH PASSWORD 'password';"
psql pygame -c "GRANT ALL PRIVILEGES ON DATABASE pygame to pygame;"

We also create a database for running tests:

createdb pygame_test
psql pygame -c "CREATE USER pygame_test WITH PASSWORD 'password';"
psql pygame_test -c "GRANT ALL PRIVILEGES ON DATABASE pygame_test to pygame_test;"

To upgrade to latest model changes do:

alembic upgrade head

When you change a model make an alembic revision:

alembic revision --autogenerate -m "Added a field for these reasons."

Then you will need to apply the change to your db (and commit the version file):

alembic upgrade head

testing with pytest

http://docs.pytest.org/en/latest/

To run all unit tests and functional tests use:

pytest

To watch for changes and rerun tests:

ptw

Maybe you just want to test the wiki parts:

pytest -k wiki

tests/unit/ are for unit tests. tests/functional/ are for tests which would use flask and db. tests/conftest.py is for test configuration. tests/sqlpytestflask.py are some fixtures for db testing.

Unit tests and functional tests are kept separate, because functional tests can take a while longer to run.

We use various fixtures to make writing the tests easier and faster.

Running the webserver locally

Use an environment variable to configure the database connection (see the database setup steps above):

export APP_DATABASE_URL="postgresql://pygame:password@localhost/pygame"

Configure a directory containing static files:

export APP_WWW="static/"

The application may need a secure key, but for debugging it's not important that it's properly random:

export APP_SECRET_KEY="s3cret-stuff-blah"

Finally, you can enable some Flask debugging machinery (which should be off for the site in production):

export APP_DEBUG=1

Now add the database fixtures to populate it with sample users. After that, you should be able to login as admin with email [email protected] and password password:

pygameweb_fixtures

Then run:

pygameweb_front

Templates with jinja2 and bootstrap

pygameweb/templates/

We use:

* `Jinja2 <http://jinja.pocoo.org/>`_
* `Flask-Bootstrap <https://pythonhosted.org/Flask-Bootstrap/basic-usage.html>`_
* `Bootstrap <http://getbootstrap.com/>`_

Command line tools with click

We use click and setuptools entry points (in setup.py) for command line tools:

* `click <http://click.pocoo.org/5/>`_
* `entry points <https://packaging.python.org/distributing/#entry-points>`_

Note, when you add or change a command line tool, you need to pip install -e . again.

If you can, try not to use command line options at all. Have one command do one thing, and make the defaults good, or use the pygameweb.config.

User login with Flask-security-fork

pygameweb.user pygameweb/templates/security

Using:

* `flask-security-fork <https://flask-security-fork.readthedocs.io/en/latest/quickstart.html>`_

Navigation with flask-nav

pygameweb.nav pygameweb.page.models

Using:

* `flask-nav <http://pythonhosted.org/flask-nav/>`_
* `flask-bootstrap <https://pythonhosted.org/Flask-Bootstrap/nav.html>`_

Dashboard is an overview

of all sorts of things happening in the pygame worlds around the interwebs.

https://pygame.org/dashboard

It's a 7000px wide webpage offering a summary of what's happening.

Projects people are working on, videos folks are making, tweets twits are... tweeting, questions asked and answered.

To caching things we

use Flask-Caching

pygameweb.cache pygameweb.news.views

With with a @cache decorator, and/or markup in a template.

Releases

Step by step release instructions below.

  • Commits to master branch do a dev deploy to pypi.
  • Commits to mastertest branch do a dev deploy to pypi.
  • Commits to a tag do a real deploy to pypi.

Prereleases

https://packaging.python.org/tutorials/distributing-packages/#pre-release-versioning

Pre releases should be named like this: ` # pygameweb/__init__.py __version__ = '0.0.2' ` Which is one version ahead of of the last tagged release.

Release tags should be like '0.0.2', and match the pygameweb/__init__.py __version__.

Preparing a release in a branch.

It's a good idea to start a branch first, and make any necessary changes for the release.

` git checkout -b v0.0.2 vi pygameweb/__init__.py __version__ = '0.0.2' git commit -m "Version 0.0.2" `

Change log, drafting a release.

Github 'releases' are done as well. You can start drafting the release notes in there before the tag. https://help.github.com/articles/creating-releases/

You can make the release notes with the help of the changes since last release. https://github.com/pygame/pygameweb/compare/0.0.1...master

git log 0.0.1...master

Tagging a release

When the release is tagged, pushing it starts the deploy to pypi off. ` git tag -a 0.0.2 git push origin 0.0.2 ` Note: do not tag pre releases (these are made on commits to master/mastertest).

After the tag is pushed, then you can do the release in github from your draft release.

Back to dev version.

If we were at 0.0.2 before, now we want to be at 0.0.3.dev ` vi pygameweb/__init__.py __version__ = '0.0.3.dev' `

Merge the release branch into master, and push that up.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].