Skip to main content

hatch-mypyc

CI/CD CI - Test CD - Build
Package PyPI - Version PyPI - Python Version
Meta Hatch project code style - black types - Mypy License - MIT GitHub Sponsors

This provides a build hook plugin for Hatch that compiles code with Mypyc.

Table of Contents

Configuration

The build hook plugin name is mypyc.

  • pyproject.toml

    [tool.hatch.build.targets.wheel.hooks.mypyc]
    dependencies = ["hatch-mypyc"]
    
  • hatch.toml

    [build.targets.wheel.hooks.mypyc]
    dependencies = ["hatch-mypyc"]
    

File selection

By default, all files included using the standard file selection options with a .py extension will be targeted. You can narrow what files to compile to an even smaller subset with the include/exclude options, which represent Git-style glob patterns.

[build.targets.wheel.hooks.mypyc]
include = ["/src/pkg/server"]
exclude = ["__main__.py"]

Mypy arguments

You can specify extra Mypy arguments with the mypy-args option.

[build.targets.wheel.hooks.mypyc]
mypy-args = [
  "--disallow-untyped-defs",
]

Options

You can specify options that affect the behavior of mypycify.

[build.targets.wheel.hooks.mypyc.options]
opt_level = "3"

Note:

  • the target_dir option is used internally and therefore has no effect

Missing types

If you need more packages at build time in order to successfully type check, you can use the following options where you configured the plugin:

  • dependencies - add more dependencies alongside hatch-mypyc
  • require-runtime-dependencies - set to true to include dependencies defined in the project.dependencies array
  • require-runtime-features - set to an array of named dependency groups that are defined in project.optional-dependencies

License

hatch-mypyc is distributed under the terms of the MIT license.

Metadata

Release files for hatch-mypyc 0.16.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hatch-mypyc 0.16.0
File Size Uploaded
hatch_mypyc-0.16.0.tar.gz 12.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hatch-mypyc 0.16.0
File Interpreter ABI Platform
hatch_mypyc-0.16.0-py3-none-any.whl Python 3 none any Details

Total release size: 21.3 kB

Release files / hatch_mypyc-0.16.0.tar.gz

Download URL hatch_mypyc-0.16.0.tar.gz
Size 12.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6e3aa99634d81142cab993358698eaae823de91fe87ee85029a82f2e737c3ded
BLAKE2b-256 checksum
How to use checksums
68baa49750d3f38dbb61d42c5ac8aa322112bc28e38bf149704172d13ad86c52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Release files / hatch_mypyc-0.16.0-py3-none-any.whl

Download URL hatch_mypyc-0.16.0-py3-none-any.whl
Size 8.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
914f060fbb060186de72935c6ca07a55a47a5242be8864f135e32e72459cad4f
BLAKE2b-256 checksum
How to use checksums
ac2e126610a897cb592188d118138b94a6e600f681fce439045777ccf8b270d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.2

Release history Release notifications | RSS feed

This release

0.16.0 This release

2 release files

0.14.1

2 release files

0.14.0

2 release files

0.13.0

2 release files

0.12.0

2 release files

0.10.0

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4

2 release files

0.3

2 release files

0.2

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page