Giter Site home page Giter Site logo

python-app-google-groups's Introduction

Google Groups App

Slack app for managing Google Groups

Check out the wiki for more info.

Deployment

To get a copy of the deployable wheel or PEX file, follow these instructions:

# Ensure dependencies have been generated
make requirements
# Build a Python wheel
make wheel
# Build a PEX package
make pex

After that, you can follow the instructions on the wiki for acquiring the necessary credentials and writing the config.

Development

Quick Start

# Initialize the repo (Add git hooks and create venv)
make init
# Run the project
source ~/dev/.env/app_google_groups/bin/activate
python3 -m app_google_groups
# This also works
python3 app_google_groups/main.py
# Nuke everything that was created dynamically so you can start again
make clean

Running tests

The test suite requires an operational mysql server in order to function. To configure the credentials, copy tests/_dbcreds.example.py to tests/_dbcreds.py, and set your credentails appropriately.

Once that's done you can run make test to run the test suite.

Note this is a CI-free project, and tests will be run as part of the commit hook when you make a commit, and the coverage report will be appended to the message.

Project Structure

All Python code for the project lies under the app_google_groups directory. The main.py is automatically read by Python when the project is loaded as a module (-m flag on the interpreter). This makes it convenient to run and allows for correct relative import resolution regardless of other installations of the project on the system. main.py is the real main file for the project, and where you should put the initialisation of your code.

The setup.py is also a Python module in itself, and offers a bunch of commands for distribution management. The only one in use right now is bdist_wheel, which is called by the "wheel" Make target. To see the other commands, run python3 -m setup.py --help-commands.

When the wheel is installed, the project can either be imported like any other Python module in other Python code, or you can run it at the command line by calling app_google_groups. This executable is created by Pip during install, and is platform agnostic. If you are writing a pure library, you may want to remove the entry_points section from setup.py.

Under requirements, there are 2 .in files and 2 .txt files after running make requirements. The dev.in and prod.in is where you should specify dependencies for either environment. The .txt files are "compiled" lists of requirements, which pin versions for all packages required plus their depenencies. This prevents your environment drifiting over time. These files can be committed to Github if you really want, however your constraints in the .in files should be sufficient to keep your project working. When you change the .in files make sure to run make requirements again.

The init.py should not contain any actual code, just imports. Constants may be able to break the exception, but creating a constants.py makes importing your constants simpler everwhere. That's not to say you can't import constants.py in the init.py, you should also do that.

python-app-google-groups's People

Contributors

m1cr0man avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

isabella232

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.