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-0b0.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-0b0-py3-none-any.whl (44.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: titan-zeus-0b0.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-0b0.tar.gz
Algorithm Hash digest
SHA256 84b62d6a2280f8110a020e393cd2b1e0d820a2ae21387a1909ec22a57df0fbe4
MD5 249dc863fe7ab5df3df8a0dff9cbb4ad
BLAKE2b-256 d11eb471887d4b80f27dd6cd9093d01a1ad11c6d7486fa4519095bbb5dd8eed1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: titan_zeus-0b0-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-0b0-py3-none-any.whl
Algorithm Hash digest
SHA256 f1f97f40341b5dccb9032b64450077a07c8b6e880a513de9727187dfe603c9bf
MD5 450f5277fc62018b72cc1d06506828c7
BLAKE2b-256 67ec2af6459cd15c2c8b078ea9aa52209b9eeb07319266d2845fb51c746e476d

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