pydeps2env


Namepydeps2env JSON
Version 1.0.0 PyPI version JSON
download
home_page
SummaryA python helper to generate conda environment files from project dependencies.
upload_time2024-03-11 21:00:55
maintainer
docs_urlNone
author
requires_python>=3.9
licenseBSD 3-Clause License Copyright (c) 2022, Cagtay Fabry 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 COPYRIGHT HOLDER 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.
keywords conda pyproject
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pydeps2env

An easy way to create conda environment files from you python project dependencies.  
Creates a conda `environment.yml` file from python package dependencies listed in a `pyproject.toml` or `setup.cfg` file.

The project contains
- GitHub action
- python package
- command line script

```mermaid
flowchart LR
    pyproject.toml --> pydeps2env
    setup.cfg --> pydeps2env
    environment.yaml --> pydeps2env
    requirements.txt --> pydeps2env
    pydeps2env --> E2[environment.yaml]
    pydeps2env --> R2[requirements.txt]
```

## basic usage (GitHub action)

By default, the action will parse a `pyproject.toml` file in your root directory into `environment.yml`. Here is an example
of a simple setup:

```yaml
steps:
  - uses: CagtayFabry/pydeps2env@v1.0.0
```

```toml
[project]
requires-python = ">=3.8,<3.10"
dependencies = [
    "numpy >=1.20",
    "pandas >=1.0",
    "IPython",
    "boltons",
]
[project.optional-dependencies]
test = ["pytest"]
pip_only = ["bidict"]
```

The default parameters will output this sorted `environment.yml` (note that the `python` dependency will always be the first item on the list):

```yaml
channels:
  - defaults
dependencies:
  - python>=3.8,<3.10
  - boltons
  - IPython
  - numpy>=1.20
  - pandas>=1.0
```

A full output with options `--build_system include --extras test pip_only --pip bidict`

```yaml
channels:
  - defaults
dependencies:
  - python>=3.8,<3.10
  - boltons
  - IPython
  - numpy>=1.20
  - pandas>=1.0
  - pytest
  - setuptools>=40.9.0
  - setuptools_scm
  - wheel
  - pip:
    - bidict
```

## configuration options

To customize the output the input options are available to the action:

### files

Specify the location of the `'setup.cfg'` or `'pyproject.toml'` files to parse. (defaults to `'pyproject.toml'`)
Multiple files can be listed. This will result in a combined environment file.

### output:

Specify the location and name of the conda environment file to generate. (defaults to `'environment.yml'`)

### channels:

List the conda channels to include in the environment file. (defaults to `'conda-forge'`)
Separate a list of multiple channels by spaces (e.g. `'conda-forge defaults'`).

### extras:

Specify one or more optional `[extras_require]` sections to add to all the environments (e.g. `'test'` to include package that
you would normally install with `pip install pkg[test]`).
Note that for individual packages, the [extra]` syntax is also possible.

### build_system:

If set to `'include'` the dependencies listed under `[build-system]` (or `[options:setup_requires]` in `setup.cfg`) will be added to the environment (default
is `'omit'` so no setup dependencies will be installed).

### pip
List of packages to install via `pip` instead of `conda`.
The dependencies will be listet under the `pip:` section in the environment file.

## example

```yaml
steps:
  - uses: CagtayFabry/pydeps2env@v1.0.0
    with:
      files: ./test/pyproject.toml[doc] ./test/setup.cfg # comine both files, add [doc] only for pyproject.toml
      output: 'environment_test.yml'
      channels: 'conda-forge defaults'
      extras: 'test'
      build_system: 'include'
      pip: 'bidict'
```

```toml
[project]
requires-python = ">=3.8,<3.10"
dependencies = [
    "numpy >=1.20",
    "pandas >=1.0",
    "IPython",
    "boltons",
]
[project.optional-dependencies]
test = ["pytest"]
pip_only = ["bidict"]
```

```yaml
channels:
  - conda-forge
  - defaults
dependencies:
  - python>=3.8,<3.10
  - boltons
  - IPython
  - numpy>=1.20
  - pandas>=1.0
  - pytest
  - setuptools>=40.9.0
  - setuptools_scm
  - sphinx
  - wheel
  - pip:
    - bidict
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "pydeps2env",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "conda,pyproject",
    "author": "",
    "author_email": "\u00c7a\u011ftay Fabry <cagtay.fabry@bam.de>",
    "download_url": "https://files.pythonhosted.org/packages/6e/ea/7db8429b0bd81bee622e626640e57be2ef0a9490f80252aeddd830dabe6a/pydeps2env-1.0.0.tar.gz",
    "platform": null,
    "description": "# pydeps2env\r\n\r\nAn easy way to create conda environment files from you python project dependencies.  \r\nCreates a conda `environment.yml` file from python package dependencies listed in a `pyproject.toml` or `setup.cfg` file.\r\n\r\nThe project contains\r\n- GitHub action\r\n- python package\r\n- command line script\r\n\r\n```mermaid\r\nflowchart LR\r\n    pyproject.toml --> pydeps2env\r\n    setup.cfg --> pydeps2env\r\n    environment.yaml --> pydeps2env\r\n    requirements.txt --> pydeps2env\r\n    pydeps2env --> E2[environment.yaml]\r\n    pydeps2env --> R2[requirements.txt]\r\n```\r\n\r\n## basic usage (GitHub action)\r\n\r\nBy default, the action will parse a `pyproject.toml` file in your root directory into `environment.yml`. Here is an example\r\nof a simple setup:\r\n\r\n```yaml\r\nsteps:\r\n  - uses: CagtayFabry/pydeps2env@v1.0.0\r\n```\r\n\r\n```toml\r\n[project]\r\nrequires-python = \">=3.8,<3.10\"\r\ndependencies = [\r\n    \"numpy >=1.20\",\r\n    \"pandas >=1.0\",\r\n    \"IPython\",\r\n    \"boltons\",\r\n]\r\n[project.optional-dependencies]\r\ntest = [\"pytest\"]\r\npip_only = [\"bidict\"]\r\n```\r\n\r\nThe default parameters will output this sorted `environment.yml` (note that the `python` dependency will always be the first item on the list):\r\n\r\n```yaml\r\nchannels:\r\n  - defaults\r\ndependencies:\r\n  - python>=3.8,<3.10\r\n  - boltons\r\n  - IPython\r\n  - numpy>=1.20\r\n  - pandas>=1.0\r\n```\r\n\r\nA full output with options `--build_system include --extras test pip_only --pip bidict`\r\n\r\n```yaml\r\nchannels:\r\n  - defaults\r\ndependencies:\r\n  - python>=3.8,<3.10\r\n  - boltons\r\n  - IPython\r\n  - numpy>=1.20\r\n  - pandas>=1.0\r\n  - pytest\r\n  - setuptools>=40.9.0\r\n  - setuptools_scm\r\n  - wheel\r\n  - pip:\r\n    - bidict\r\n```\r\n\r\n## configuration options\r\n\r\nTo customize the output the input options are available to the action:\r\n\r\n### files\r\n\r\nSpecify the location of the `'setup.cfg'` or `'pyproject.toml'` files to parse. (defaults to `'pyproject.toml'`)\r\nMultiple files can be listed. This will result in a combined environment file.\r\n\r\n### output:\r\n\r\nSpecify the location and name of the conda environment file to generate. (defaults to `'environment.yml'`)\r\n\r\n### channels:\r\n\r\nList the conda channels to include in the environment file. (defaults to `'conda-forge'`)\r\nSeparate a list of multiple channels by spaces (e.g. `'conda-forge defaults'`).\r\n\r\n### extras:\r\n\r\nSpecify one or more optional `[extras_require]` sections to add to all the environments (e.g. `'test'` to include package that\r\nyou would normally install with `pip install pkg[test]`).\r\nNote that for individual packages, the [extra]` syntax is also possible.\r\n\r\n### build_system:\r\n\r\nIf set to `'include'` the dependencies listed under `[build-system]` (or `[options:setup_requires]` in `setup.cfg`) will be added to the environment (default\r\nis `'omit'` so no setup dependencies will be installed).\r\n\r\n### pip\r\nList of packages to install via `pip` instead of `conda`.\r\nThe dependencies will be listet under the `pip:` section in the environment file.\r\n\r\n## example\r\n\r\n```yaml\r\nsteps:\r\n  - uses: CagtayFabry/pydeps2env@v1.0.0\r\n    with:\r\n      files: ./test/pyproject.toml[doc] ./test/setup.cfg # comine both files, add [doc] only for pyproject.toml\r\n      output: 'environment_test.yml'\r\n      channels: 'conda-forge defaults'\r\n      extras: 'test'\r\n      build_system: 'include'\r\n      pip: 'bidict'\r\n```\r\n\r\n```toml\r\n[project]\r\nrequires-python = \">=3.8,<3.10\"\r\ndependencies = [\r\n    \"numpy >=1.20\",\r\n    \"pandas >=1.0\",\r\n    \"IPython\",\r\n    \"boltons\",\r\n]\r\n[project.optional-dependencies]\r\ntest = [\"pytest\"]\r\npip_only = [\"bidict\"]\r\n```\r\n\r\n```yaml\r\nchannels:\r\n  - conda-forge\r\n  - defaults\r\ndependencies:\r\n  - python>=3.8,<3.10\r\n  - boltons\r\n  - IPython\r\n  - numpy>=1.20\r\n  - pandas>=1.0\r\n  - pytest\r\n  - setuptools>=40.9.0\r\n  - setuptools_scm\r\n  - sphinx\r\n  - wheel\r\n  - pip:\r\n    - bidict\r\n```\r\n",
    "bugtrack_url": null,
    "license": "BSD 3-Clause License  Copyright (c) 2022, Cagtay Fabry 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 COPYRIGHT HOLDER 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. ",
    "summary": "A python helper to generate conda environment files from project dependencies.",
    "version": "1.0.0",
    "project_urls": {
        "bug_tracker": "https://github.com/CagtayFabry/pydeps2env/-/issues",
        "repository": "https://github.com/CagtayFabry/pydeps2env"
    },
    "split_keywords": [
        "conda",
        "pyproject"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "534d2ff0538f243b7c2fe05520c2892c42bbcd4572c5848b97010afc3017e2bd",
                "md5": "b84228dd139bd067e6ef7708759ce5f4",
                "sha256": "12653699c58c981b4d15845f448f180a19035bc0cad9ec42578b73a4efada3bf"
            },
            "downloads": -1,
            "filename": "pydeps2env-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b84228dd139bd067e6ef7708759ce5f4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 8585,
            "upload_time": "2024-03-11T21:00:53",
            "upload_time_iso_8601": "2024-03-11T21:00:53.101028Z",
            "url": "https://files.pythonhosted.org/packages/53/4d/2ff0538f243b7c2fe05520c2892c42bbcd4572c5848b97010afc3017e2bd/pydeps2env-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6eea7db8429b0bd81bee622e626640e57be2ef0a9490f80252aeddd830dabe6a",
                "md5": "efc9b3dbcec88d421df1a72496e818db",
                "sha256": "70b42951570ef84fde2e4ad70a1f5f62b3a492c73ad06250e3fd8511cf59d8ee"
            },
            "downloads": -1,
            "filename": "pydeps2env-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "efc9b3dbcec88d421df1a72496e818db",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 10888,
            "upload_time": "2024-03-11T21:00:55",
            "upload_time_iso_8601": "2024-03-11T21:00:55.891216Z",
            "url": "https://files.pythonhosted.org/packages/6e/ea/7db8429b0bd81bee622e626640e57be2ef0a9490f80252aeddd830dabe6a/pydeps2env-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-11 21:00:55",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "CagtayFabry",
    "github_project": "pydeps2env",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pydeps2env"
}
        
Elapsed time: 0.21125s