Skip to main content
Latest release PyPI License CI status Codecov

This project provides a pydantic model of the fpm package manifest format used in the Fortran package manager.

Installation

Install this project with pip

pip install git+https://github.com/fortran-lang/fpm-metadata

Usage

You can read a package manifest with your TOML library of choice and construct a manifest object from it which allows to access all package entries directly in Python

>>> from fpm.metadata import Manifest
>>> from tomlkit import loads
>>> with open("fpm.toml") as fh:
...     package = Manifest(**loads(fh.read()))
...
>>> package.name
'fpm'
>>> package.version
'0.2.0'

Alternatively, you can use the load_manifest function to read a package manifest

>>> from pathlib import Path
>>> from fpm.metadata import load_manifest
>>> package = load_manifest(Path("fpm.toml"))
>>> package.name
'fpm'
>>> package.version
'0.2.0'

Finally, you can dump a package manifest to a TOML string using the dump_manifest function

>>> from pathlib import Path
>>> from fpm.metadata import dump_manifest, load_manifest
>>> package = load_manifest(Path("fpm.toml"))
>>> print(dump_manifest(package))
name = "fpm"
version = "0.2.0"
...

Development

This project is hosted on GitHub at fortran-lang/fpm-metadata. Obtain the source by cloning the repository with

git clone https://github.com/fortran-lang/fpm-metadata
cd fpm-metadata

We recommend using a conda environment to install the package. You can setup the environment manager using a mambaforge installer. Install the required dependencies from the conda-forge channel.

mamba env create -n devel -f environment.yml
mamba activate devel

Install this project with pip in the environment

pip install .

Add the option -e for installing in development mode.

The following dependencies are required

You can check your installation by running the test suite with

pytest tests/ --pyargs fpm.metadata --doctest-modules

For code formatting black is used:

black src/ tests/

Contributing

This is a volunteer open source projects and contributions are always welcome. Please, take a moment to read the contributing guidelines.

License

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “as is” basis, without warranties or conditions of any kind, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.

Metadata

Release files for fpm-metadata 0.2.2

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

Source distribution (sdist)

Source distribution for fpm-metadata 0.2.2
File Size Uploaded
fpm-metadata-0.2.2.tar.gz 11.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fpm-metadata 0.2.2
File Interpreter ABI Platform
fpm_metadata-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 22.3 kB

Release files / fpm-metadata-0.2.2.tar.gz

Download URL fpm-metadata-0.2.2.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ec9a14cf6be6ae56ce906d69cd0bdaaa5775b25dc6e0b18a55c576a26c778967
BLAKE2b-256 checksum
How to use checksums
4c4337f2ad51c312a5548da200eb31b89e24e09c8aa9355526e456c3b0320357
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / fpm_metadata-0.2.2-py3-none-any.whl

Download URL fpm_metadata-0.2.2-py3-none-any.whl
Size 11.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e12b024f07bc4563b2f63f5fb8d4771591f0b8c8cf5021872a770b9750d97acc
BLAKE2b-256 checksum
How to use checksums
21bd12d65c792bfe277725de53d99e804540283c456c305df94645e312487485
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

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