Skip to main content

No project description provided

Project description

zeus

Docs are still lagging...

What is this?

This is a collection of tools extracted from a multi-project django monolith. Because we're new to publishing packages, there are a few gotchas:

  • This is a monolithic package/install. Consumers can't just install a part, but must install the entire thing.
    • This also means the whole thing is versioned together. If we add a shiny new feature after a totally independent breaking change, consumers can't get the new feature without the breaking change.
  • This tool doesn't include external dependencies, you will have to install those yourself. We did this so consumers don't need to install packages they may not use.

List of packages and utilities

Utils are grouped by the following package names. That means you import them as so:

from zeus.vanilla import is_ascii

vanilla

  • is_ascii
  • are_strings_close_enough
  • group_by

versioning

versioning model behaviour has no external dependencies.

Subclassing versioning.core.VersionModel will create a history model that is automatically updated on each save. See the example

changelog (in progress)

changelogs requires many external dependencies: graphene, aiodataloader, graphene-django

creating changelogs currently require a lot of boilerplate code.

TODO: create a function that abstracts away all the graphql and allows querying paginated changelog data for specific models, fields, users and dates.

i18n

Depends on django, bleach, mistune and pyyaml

  • TextMakerCreator(global_keys,text_file_paths)
  • WatchingTextMakerCreator((global_keys,text_file_paths)
    • if using runserver and settings.DEBUG=True, requires watchdog

markdown

requires django, bleach and mistune to be installed

  • markdown
  • is_md_valid
  • sanitize_html

How to build dist and egginfo

# in this project:
python setup.py sdist

How to install this locally without pypi (test this right before deploying a new version)

editable mode

When refreshing a local package, you'll also need pip uninstall -y zeus in between installs. This is super annoying, fortunately there's an easier way for python to link directly to the sources so this isn't necessary:

pip uninstall zeus

# then replace zeus in requirements.txt with the following
# -e file:///absolute/path/to/zeus/

locally packaged mode

Once you've got something that work in editable mode, try packaging the app

# in zeus project
python setup.py sdist

# in consumer project
pip uninstall -y zeus
# replace the zeus entry in requirements.txt with 
#file:///absolute/path/to/zeus/

Installing from git with branch (primary way)

the entry in requirements.txt should look like this

git+git://github.com/TBS-EACPD/zeus@release-0.1#egg=zeus

To update zeus, you'll need to pip uninstall -y zeus before re-running your pip install -r requirements.txt

Development

TODO: get postgres, CI, etc. configured in a similar fashion to titan

The development environment should similar to the OG titan

  1. Install postgres postgres 9.6 and configure your $PATH
  2. Set up the virtual environment
  3. run createdb zeus-dev

Releases

At this point, consumers just use git reference in their requirements.txt to install zeus. Instead of tagging commits with git tags, which github can't protect, we use branches. To create a release, create a new branch release-<MAJOR>-<MINOR>-<PATCH> and push it up.

If you're adding a feature, the recommended flow is to

  1. Open up a feature branch (e.g. branch my-feature)
  2. get your PR approved and merged into master
  3. Create a release branch from master and push it up.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

titan-zeus-0a0.tar.gz (30.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

titan_zeus-0a0-py3-none-any.whl (44.3 kB view details)

Uploaded Python 3

File details

Details for the file titan-zeus-0a0.tar.gz.

File metadata

  • Download URL: titan-zeus-0a0.tar.gz
  • Upload date:
  • Size: 30.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for titan-zeus-0a0.tar.gz
Algorithm Hash digest
SHA256 7ad5b932ddf6a3fc2ba9713e2fa1b32b7e557e8e2c183a42916e14ed2b804d90
MD5 8e1694661e67810648ac73dc345b0ae6
BLAKE2b-256 107e4421283a34caed7a08aceae782cc195b3478be2177bdadf629afe881fff0

See more details on using hashes here.

File details

Details for the file titan_zeus-0a0-py3-none-any.whl.

File metadata

  • Download URL: titan_zeus-0a0-py3-none-any.whl
  • Upload date:
  • Size: 44.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for titan_zeus-0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 bee5cf7194e174be31e6a8b644610bceb148f2e970f234712d9ccd9579436de0
MD5 65416785b7e9ce3373cc7f2c6ebd9ce8
BLAKE2b-256 b525d004f74c576a528a80a8501c334d514eb83212d344a780a8ba91ae597591

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page