Skip to main content

A sample project for ORM

Project description

py-flat-orm

PyPI - Version PyPI - Python Version


Table of Contents

Installation

pip install py-flat-orm

Get Started

This project is set up using hatch.

  • Run xi_init.ps1 or xi_init.sh to apply pyproject.toml
    • run exit (deactivate env) first if you get Cannot remove active environment: py-flat-orm
  • to other .ps1 or .sh files for relevant tasks
  • x1 means execution, and generally the 1st thing to run
  • run hatch -h

Project Creation

Initialisation

  • This project is generated using hatch new py-flat-orm
  • pyproject.toml is then edited to include [tool.hatch.envs.py-flat-orm] etc.
  • script files e.g. x*.ps1 are added
  • set up with git
  • Run e.g. xi_init.ps1 to apply pyproject.toml

Sync Dependencies

  • run hatch shell to activate env, it also syncs dependencies

Tests Data

  • use ./test_data directory put test data
    • test data cannot be put into ./tests, otherwise when running hatch test, it treats them as tests to execute
    • you can pattern exclude these files but that requires more project config

Test in PyCharm

  • mark tests as Test Root, allows right-clicking directories inside to run tests
  • run tests from root, and save test config as a file e.g. test.run.xml
  • IMPORTANT: unmark tests as Test Root once test.run.xml is generated
    • if tests is marked as root, you CANNOT run a single test file,
    • because it treats tests as root and can't find files within src
    • you can verify this by putting import sys; print(sys.path) at the top of a test file and run it

Static Analysis

  • add dependency mypy
  • each package needs to add an empty py.typed file to make pycharm happy
  • so each package has __init__.py and py.typed, seems pointless, just live with them

Publish

  • hatch build
  • hatch publish - ask chatGPT how to set up a PyPI Account

License

py-flat-orm is distributed under the terms of the MIT license.

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

py_flat_orm-0.2.0.tar.gz (51.9 kB view details)

Uploaded Source

Built Distribution

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

py_flat_orm-0.2.0-py3-none-any.whl (20.2 kB view details)

Uploaded Python 3

File details

Details for the file py_flat_orm-0.2.0.tar.gz.

File metadata

  • Download URL: py_flat_orm-0.2.0.tar.gz
  • Upload date:
  • Size: 51.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.27.0

File hashes

Hashes for py_flat_orm-0.2.0.tar.gz
Algorithm Hash digest
SHA256 1e6807565d98d9be380479f07c2d27034b2139f5f4fdbb0574f4094b5632a6f7
MD5 1046b983ac1426d0eed723f3e1a716f5
BLAKE2b-256 8ea9f47c026a8b50a79db9d4e85d6835efd8208c0b3e161c041ff47cfdf2870b

See more details on using hashes here.

File details

Details for the file py_flat_orm-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: py_flat_orm-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 20.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.27.0

File hashes

Hashes for py_flat_orm-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9412fdd6c09b01a6c566ba0038d35d9c538ed66b6d229d93801982e75c0a39b1
MD5 c405ebd9d3f31ba3be79a7d27097c73b
BLAKE2b-256 a9a03944c6254303c5ab05919b74dec028a0100e45943f3506c600c29ce0ea4c

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