A python module which also defines how to build and publish source distributions and wheels.
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait PythonModuletrait TaskModuletrait PipModuletrait Moduletrait ModuleApitrait Wrapperclass BaseClasstrait Cachertrait Cacherclass Objecttrait Matchableclass AnyShow all
Members list
Type members
Inherited classlikes
Attributes
- Inherited from:
- PythonModule
- Supertypes
-
trait PythonModuletrait TaskModuletrait PipModuletrait Moduletrait ModuleApitrait Wrapperclass BaseClasstrait Cachertrait Cacherclass Objecttrait Matchableclass AnyShow all
Miscellaneous machinery around traversing & querying the build hierarchy, that should not be needed by normal users of Mill
Miscellaneous machinery around traversing & querying the build hierarchy, that should not be needed by normal users of Mill
Attributes
- Inherited from:
- Module
- Supertypes
-
class Internalclass Objecttrait Matchableclass Any
Value members
Abstract methods
Metadata about your project, required to build and publish.
Metadata about your project, required to build and publish.
This is roughly equivalent to what you'd find in the general section of a pyproject.toml
file https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#about-your-project.
Attributes
The artifact version that this module would be published as.
The artifact version that this module would be published as.
Attributes
Concrete methods
Files to be included in the directory used during the packaging process, apart from pyproject.
Run twine check
to catch some common packaging errors.
Run twine check
to catch some common packaging errors.
Attributes
The direct dependencies of this module. This is meant to be overridden to add dependencies.
The direct dependencies of this module. This is meant to be overridden to add dependencies.
Attributes
- Definition Classes
Publish the sdist and wheel to the package repository (index) defined in this module.
You can configure this command by setting any environment variables understood by twine
, prefixed with MILL_
. For example, to change the repository URL:
MILL_TWINE_REPOSITORY_URL=https://test.pypi.org/legacy/
Attributes
- See also
All artifacts that should be published.
All artifacts that should be published.
Attributes
The readme file to include in the published distribution.
The readme file to include in the published distribution.
Attributes
The repository (index) URL to publish packages to.
The repository (index) URL to publish packages to.
Attributes
The content of the PEP-518-compliant pyproject.toml
file, which describes how to package this module into a distribution (sdist and wheel).
The content of the PEP-518-compliant pyproject.toml
file, which describes how to package this module into a distribution (sdist and wheel).
By default, Mill will generate this file for you from the information it knows (e.g. dependencies declared in pythonDeps and metadata from publishMeta). It will use setuptools
as the build backend, and build
as the frontend.
You can however override this task to read your own pyproject.toml
file, if you need to. In this case, please note the following:
-
Mill will create a source distribution first, and then use that to build a binary distribution (aka wheel). Going through this intermediary step, rather than building a wheel directly, ensures that end users can rebuild wheels on their systems, for example if a platform-dependent wheel is not available pre-made.
-
Hence, the source distribution will need to be "self contained". In particular this means that you can't reference files by absolute path within it.
-
Mill creates a "staging" directory in the sdist task, which will be used to bundle everything up into an sdist (via the
build
python command, although this is an implementation detail). You can include additional files in this directory via the buildFiles task.
Attributes
Any python dependencies for development tools you want to add to this module.
Any python dependencies for development tools you want to add to this module.
These dependencies are similar to pythonDeps
, but will not be required to install this module, only to work on it. For example, type checkers, linters, and bundlers should be declared here.
Attributes
- See also
- Definition Classes
Bundle everything up into a source distribution (sdist).
Inherited methods
Bundles the project into a single PEX executable(bundle.pex).
Bundles the project into a single PEX executable(bundle.pex).
Attributes
- Inherited from:
- PythonModule
Command-line options to pass as bundle configuration defined by the user.
Command-line options to pass as bundle configuration defined by the user.
Attributes
- Inherited from:
- PythonModule
Opens up a Python console with your module and all dependencies present, for you to test and operate your code interactively.
Opens up a Python console with your module and all dependencies present, for you to test and operate your code interactively.
Attributes
- Inherited from:
- PythonModule
The name of the default command, which will be automatically executed if the module name is provided at the Mill command line.
The name of the default command, which will be automatically executed if the module name is provided at the Mill command line.
Attributes
- Definition Classes
-
PythonModule -> TaskModule
- Inherited from:
- PythonModule
Any environment variables you want to pass to the forked Env
Any environment variables you want to pass to the forked Env
Attributes
- Inherited from:
- PythonModule
Folders containing source files that are generated rather than handwritten; these files can be generated in this target itself, or can refer to files generated from other targets
Folders containing source files that are generated rather than handwritten; these files can be generated in this target itself, or can refer to files generated from other targets
Attributes
- Inherited from:
- PythonModule
Python interpreter found on the host system. This will be used to create a new virtual environment, which will be used by all tasks in this module.
Python interpreter found on the host system. This will be used to create a new virtual environment, which will be used by all tasks in this module.
If you'd like to use a specific python version, override this task to point to a specific python executable.
Examples:
// use whatever python version is installed on the host system (default)
def hostPythonCommand = T{ "python3" }
// use a specific minor release
def hostPythonCommand = T{ "python3.12" }
// use a specific executable file
def hostPythonCommand = T{ "/usr/bin/python3" }
Attributes
- Inherited from:
- PythonModule
Base URLs of the Python Package Indexes to search for packages. Defaults to https://pypi.org/simple.
Base URLs of the Python Package Indexes to search for packages. Defaults to https://pypi.org/simple.
These should point to repositories compliant with PEP 503 (the simple repository API) or local directories laid out in the same format.
Attributes
- Inherited from:
- PipModule
The directories used to construct the PYTHONPATH for this module, used for execution, excluding upstream modules.
The directories used to construct the PYTHONPATH for this module, used for execution, excluding upstream modules.
This includes source directories, resources and other unmanaged directories.
Attributes
- Inherited from:
- PythonModule
The python script to run. This file may not exist if this module is only a library.
The python script to run. This file may not exist if this module is only a library.
Attributes
- Inherited from:
- PythonModule
Attributes
- Inherited from:
- BaseClass
Attributes
- Inherited from:
- Module
Attributes
- Inherited from:
- Module
Attributes
- Inherited from:
- Module
Attributes
- Inherited from:
- Module
Arguments to be passed to pip install
when preparing the environment.
Arguments to be passed to pip install
when preparing the environment.
This task is called by pythonExe
. It serves as an escape hatch, should you need to override it for some reason. Normally, you should not need to edit this task directly. Instead, prefer editing the other tasks of this module which influence how the arguments are created.
Attributes
- See also
- Inherited from:
- PipModule
Any python dependencies you want to add to this module. The format of each dependency should be the same as used with pip install
, or as you would find in a requirements.txt
file. E.g. def pythonDeps = Seq("numpy==2.1.3")
.
Any python dependencies you want to add to this module. The format of each dependency should be the same as used with pip install
, or as you would find in a requirements.txt
file. E.g. def pythonDeps = Seq("numpy==2.1.3")
.
Dependencies declared here will also be required when installing this module.
Attributes
- Inherited from:
- PipModule
An executable python interpreter. This interpreter is set up to run in a virtual environment which has been initialized to contain all libraries and tools needed by this module and its dependencies.
An executable python interpreter. This interpreter is set up to run in a virtual environment which has been initialized to contain all libraries and tools needed by this module and its dependencies.
Attributes
- Inherited from:
- PythonModule
Command-line options to pass to the Python Interpreter defined by the user.
Command-line options to pass to the Python Interpreter defined by the user.
Attributes
- Inherited from:
- PythonModule
Python dependencies declared in requirements.txt
files. This is similar to pythonDeps
, but reads dependencies from a text file, allowing you to reuse requirements files from existing projects.
Python dependencies declared in requirements.txt
files. This is similar to pythonDeps
, but reads dependencies from a text file, allowing you to reuse requirements files from existing projects.
Attributes
- See also
- Inherited from:
- PipModule
The folders where the resource files for this module live.
Run the main python script of this module.
Run the main python script of this module.
Attributes
- Inherited from:
- PythonModule
The folders where the source files for this mill module live.
The folders where the source files for this mill module live.
Python modules will be defined relative to these directories.
Attributes
- Inherited from:
- PythonModule
Returns a string representation of the object.
Returns a string representation of the object.
The default representation is platform dependent.
Attributes
- Returns
-
a string representation of the object.
- Definition Classes
-
Module -> Any
- Inherited from:
- Module
Python dependencies of this module, and all other modules that this module depends on, recursively.
Python dependencies of this module, and all other modules that this module depends on, recursively.
Attributes
- Inherited from:
- PipModule
The transitive version of localPythonPath: this includes the directories of all upstream modules as well.
The transitive version of localPythonPath: this includes the directories of all upstream modules as well.
Attributes
- Inherited from:
- PythonModule
requirements.txt of this module, and all other modules that this module depends on, recursively.
requirements.txt of this module, and all other modules that this module depends on, recursively.
Attributes
- See also
- Inherited from:
- PipModule
Any python wheels to install directly, for this module and all upstream modules, recursively.
Any python wheels to install directly, for this module and all upstream modules, recursively.
Attributes
- See also
- Inherited from:
- PipModule
Run a typechecker on this module.
Additional directories to include in the PYTHONPATH directly. These paths are "unmanaged": they'll be included as they are on disk.
Additional directories to include in the PYTHONPATH directly. These paths are "unmanaged": they'll be included as they are on disk.
Attributes
- Inherited from:
- PythonModule
Any python wheels to install directly.
Any python wheels to install directly.
Note: you can also include wheels by using direct references in pythonRequirementFiles, for example "pip @ file:///localbuilds/pip-1.3.1-py33-none-any.whl"
. However, if you do that then changes to these files won't get picked up and you are on the hook for cache invalidation. Therefore, if you have any wheels that you wish to install directly, it is recommended to add them here.
Attributes
- Inherited from:
- PipModule
Implicits
Inherited implicits
Attributes
- Inherited from:
- Module