Skip to content

Commit

Permalink
add pydantic feedstock as a resource
Browse files Browse the repository at this point in the history
  • Loading branch information
ytausch committed Aug 30, 2024
1 parent bff923f commit a34e0dd
Show file tree
Hide file tree
Showing 6 changed files with 365 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
BSD-3-Clause license
Copyright (c) 2015-2022, conda-forge contributors
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
157 changes: 157 additions & 0 deletions tests_integration/definitions/pydantic/resources/feedstock/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
About pydantic-feedstock
========================

Feedstock license: [BSD-3-Clause](https://github.com/conda-forge/pydantic-feedstock/blob/main/LICENSE.txt)

Home: https://github.com/pydantic/pydantic

Package license: MIT

Summary: Data validation and settings management using python type hinting

Development: https://github.com/pydantic/pydantic

Documentation: https://docs.pydantic.dev

Data validation and settings management using python type hinting.
See documentation <https://docs.pydantic.dev> for more details.


Current build status
====================


<table><tr><td>All platforms:</td>
<td>
<a href="https://dev.azure.com/conda-forge/feedstock-builds/_build/latest?definitionId=2633&branchName=main">
<img src="https://dev.azure.com/conda-forge/feedstock-builds/_apis/build/status/pydantic-feedstock?branchName=main">
</a>
</td>
</tr>
</table>

Current release info
====================

| Name | Downloads | Version | Platforms |
| --- | --- | --- | --- |
| [![Conda Recipe](https://img.shields.io/badge/recipe-pydantic-green.svg)](https://anaconda.org/conda-forge/pydantic) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/pydantic.svg)](https://anaconda.org/conda-forge/pydantic) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/pydantic.svg)](https://anaconda.org/conda-forge/pydantic) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/pydantic.svg)](https://anaconda.org/conda-forge/pydantic) |

Installing pydantic
===================

Installing `pydantic` from the `conda-forge` channel can be achieved by adding `conda-forge` to your channels with:

```
conda config --add channels conda-forge
conda config --set channel_priority strict
```

Once the `conda-forge` channel has been enabled, `pydantic` can be installed with `conda`:

```
conda install pydantic
```

or with `mamba`:

```
mamba install pydantic
```

It is possible to list all of the versions of `pydantic` available on your platform with `conda`:

```
conda search pydantic --channel conda-forge
```

or with `mamba`:

```
mamba search pydantic --channel conda-forge
```

Alternatively, `mamba repoquery` may provide more information:

```
# Search all versions available on your platform:
mamba repoquery search pydantic --channel conda-forge
# List packages depending on `pydantic`:
mamba repoquery whoneeds pydantic --channel conda-forge
# List dependencies of `pydantic`:
mamba repoquery depends pydantic --channel conda-forge
```


About conda-forge
=================

[![Powered by
NumFOCUS](https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A)](https://numfocus.org)

conda-forge is a community-led conda channel of installable packages.
In order to provide high-quality builds, the process has been automated into the
conda-forge GitHub organization. The conda-forge organization contains one repository
for each of the installable packages. Such a repository is known as a *feedstock*.

A feedstock is made up of a conda recipe (the instructions on what and how to build
the package) and the necessary configurations for automatic building using freely
available continuous integration services. Thanks to the awesome service provided by
[Azure](https://azure.microsoft.com/en-us/services/devops/), [GitHub](https://github.com/),
[CircleCI](https://circleci.com/), [AppVeyor](https://www.appveyor.com/),
[Drone](https://cloud.drone.io/welcome), and [TravisCI](https://travis-ci.com/)
it is possible to build and upload installable packages to the
[conda-forge](https://anaconda.org/conda-forge) [anaconda.org](https://anaconda.org/)
channel for Linux, Windows and OSX respectively.

To manage the continuous integration and simplify feedstock maintenance
[conda-smithy](https://github.com/conda-forge/conda-smithy) has been developed.
Using the ``conda-forge.yml`` within this repository, it is possible to re-render all of
this feedstock's supporting files (e.g. the CI configuration files) with ``conda smithy rerender``.

For more information please check the [conda-forge documentation](https://conda-forge.org/docs/).

Terminology
===========

**feedstock** - the conda recipe (raw material), supporting scripts and CI configuration.

**conda-smithy** - the tool which helps orchestrate the feedstock.
Its primary use is in the construction of the CI ``.yml`` files
and simplify the management of *many* feedstocks.

**conda-forge** - the place where the feedstock and smithy live and work to
produce the finished article (built conda distributions)


Updating pydantic-feedstock
===========================

If you would like to improve the pydantic recipe or build a new
package version, please fork this repository and submit a PR. Upon submission,
your changes will be run on the appropriate platforms to give the reviewer an
opportunity to confirm that the changes result in a successful build. Once
merged, the recipe will be re-built and uploaded automatically to the
`conda-forge` channel, whereupon the built conda packages will be available for
everybody to install and use from the `conda-forge` channel.
Note that all branches in the conda-forge/pydantic-feedstock are
immediately built and any created packages are uploaded, so PRs should be based
on branches in forks and branches in the main repository should only be used to
build distinct package versions.

In order to produce a uniquely identifiable distribution:
* If the version of a package **is not** being increased, please add or increase
the [``build/number``](https://docs.conda.io/projects/conda-build/en/latest/resources/define-metadata.html#build-number-and-string).
* If the version of a package **is** being increased, please remember to return
the [``build/number``](https://docs.conda.io/projects/conda-build/en/latest/resources/define-metadata.html#build-number-and-string)
back to 0.

Feedstock Maintainers
=====================

* [@davidbrochart](https://github.com/davidbrochart/)
* [@dgasmith](https://github.com/dgasmith/)
* [@pavelzw](https://github.com/pavelzw/)
* [@samuelcolvin](https://github.com/samuelcolvin/)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# This file was generated automatically from conda-smithy. To update this configuration,
# update the conda-forge.yml and/or the recipe/meta.yaml.
# -*- mode: yaml -*-

jobs:
- template: ./.azure-pipelines/azure-pipelines-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
#!/usr/bin/env python3
#
# This file has been generated by conda-smithy in order to build the recipe
# locally.
#
import glob
import os
import platform
import subprocess
from argparse import ArgumentParser


def setup_environment(ns):
os.environ["CONFIG"] = ns.config
os.environ["UPLOAD_PACKAGES"] = "False"
os.environ["IS_PR_BUILD"] = "True"
if ns.debug:
os.environ["BUILD_WITH_CONDA_DEBUG"] = "1"
if ns.output_id:
os.environ["BUILD_OUTPUT_ID"] = ns.output_id
if "MINIFORGE_HOME" not in os.environ:
os.environ["MINIFORGE_HOME"] = os.path.join(
os.path.dirname(__file__), "miniforge3"
)


def run_docker_build(ns):
script = ".scripts/run_docker_build.sh"
subprocess.check_call([script])


def run_osx_build(ns):
script = ".scripts/run_osx_build.sh"
subprocess.check_call([script])


def verify_config(ns):
valid_configs = {os.path.basename(f)[:-5] for f in glob.glob(".ci_support/*.yaml")}
print(f"valid configs are {valid_configs}")
if ns.config in valid_configs:
print("Using " + ns.config + " configuration")
return
elif len(valid_configs) == 1:
ns.config = valid_configs.pop()
print("Found " + ns.config + " configuration")
elif ns.config is None:
print("config not selected, please choose from the following:\n")
selections = list(enumerate(sorted(valid_configs), 1))
for i, c in selections:
print(f"{i}. {c}")
s = input("\n> ")
idx = int(s) - 1
ns.config = selections[idx][1]
print(f"selected {ns.config}")
else:
raise ValueError("config " + ns.config + " is not valid")
# Remove the following, as implemented
if ns.config.startswith("win"):
raise ValueError(
f"only Linux/macOS configs currently supported, got {ns.config}"
)
elif ns.config.startswith("osx"):
if "OSX_SDK_DIR" not in os.environ:
raise RuntimeError(
"Need OSX_SDK_DIR env variable set. Run 'export OSX_SDK_DIR=$PWD/SDKs' "
"to download the SDK automatically to '$PWD/SDKs/MacOSX<ver>.sdk'. "
"Note: OSX_SDK_DIR must be set to an absolute path. "
"Setting this variable implies agreement to the licensing terms of the SDK by Apple."
)


def main(args=None):
p = ArgumentParser("build-locally")
p.add_argument("config", default=None, nargs="?")
p.add_argument(
"--debug",
action="store_true",
help="Setup debug environment using `conda debug`",
)
p.add_argument("--output-id", help="If running debug, specify the output to setup.")

ns = p.parse_args(args=args)
verify_config(ns)
setup_environment(ns)

try:
if ns.config.startswith("linux") or (
ns.config.startswith("osx") and platform.system() == "Linux"
):
run_docker_build(ns)
elif ns.config.startswith("osx"):
run_osx_build(ns)
finally:
recipe_license_file = os.path.join("recipe", "recipe-scripts-license.txt")
if os.path.exists(recipe_license_file):
os.remove(recipe_license_file)


if __name__ == "__main__":
main()
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
build_platform:
linux_aarch64: linux_64
linux_ppc64le: linux_64
osx_arm64: osx_64
conda_forge_output_validation: true
github:
branch_name: main
tooling_branch_name: main
provider:
linux_aarch64: default
linux_ppc64le: default
win: azure
conda_build:
pkg_format: '2'
bot:
inspection: update-grayskull
abi_migration_branches:
- 1.x
test: native_and_emulated
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{% set name = "pydantic" %}
{% set version = "2.8.2" %}
{% set repo_url = "https://github.com/pydantic/pydantic" %}
{% set docs_url = "https://docs.pydantic.dev" %}

package:
name: {{ name }}
version: {{ version }}

source:
url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz
sha256: 6f62c13d067b0755ad1c21a34bdd06c0c12625a22b0fc09c6b149816604f7c2a

build:
noarch: python
script: {{ PYTHON }} -m pip install . --no-deps --ignore-installed -vv
number: 0

requirements:
host:
- python >=3.7
- hatchling
- hatch-fancy-pypi-readme >=22.5.0
- pip
run:
- python >=3.7
- typing-extensions >=4.6.1
- annotated-types >=0.4.0
- pydantic-core ==2.20.1

test:
imports:
- pydantic
commands:
- pip check
requires:
- pip

about:
home: {{ repo_url }}
license: MIT
license_family: MIT
license_file: LICENSE
summary: Data validation and settings management using python type hinting
description: |
Data validation and settings management using python type hinting.
See documentation <{{ docs_url }}> for more details.
doc_url: {{ docs_url }}
dev_url: {{ repo_url }}

extra:
recipe-maintainers:
- samuelcolvin
- dgasmith
- davidbrochart
- pavelzw

0 comments on commit a34e0dd

Please sign in to comment.