Skip to content

Commit

Permalink
Add installation-warning to Readme (#853)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhuppmann committed Apr 25, 2024
1 parent 7b46e61 commit 52cb754
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 72 deletions.
103 changes: 52 additions & 51 deletions .github/workflows/pytest.yml
@@ -1,4 +1,4 @@
# This workflow installs the package on several OS/Python versions and runs the tests
# This workflow installs the package on several OS & Python versions and runs the tests
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: pytest
Expand All @@ -14,16 +14,17 @@ jobs:
strategy:
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
- ubuntu-latest
- windows-latest
# use non-Arm64 version for now due to failing numpy
- macos-13
python-version:
- '3.10'
- '3.11'
- '3.12'
- '3.10'
- '3.11'
- '3.12'

fail-fast: false

defaults:
run:
shell: bash
Expand All @@ -32,52 +33,52 @@ jobs:
name: ${{ matrix.os }} py${{ matrix.python-version }}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
id: setup-python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set up Python ${{ matrix.python-version }}
id: setup-python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

#------------------------------
# install & configure poetry
#------------------------------
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
#------------------------------
# install & configure poetry
#------------------------------
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

#------------------------------------
# load cached venv if cache exists
#------------------------------------
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
#------------------------
# install your project
#------------------------
- name: Install library
run: poetry install --no-interaction --with dev,optional_io_formats,optional_plotting,tutorials,wbdata
#------------------------------------
# load cached venv if cache exists
#------------------------------------
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
#------------------------
# install your project
#------------------------
- name: Install library
run: poetry install --no-interaction --with dev,optional_io_formats,optional_plotting,tutorials,wbdata

# run tests without Matplotlib & CodeCode tests on earlier Python versions
- name: Test with pytest
if: ${{ matrix.python-version != '3.12' }}
run: poetry run pytest tests
# run tests without Matplotlib & CodeCode tests on earlier Python versions
- name: Test with pytest
if: ${{ matrix.python-version != '3.12' }}
run: poetry run pytest tests

# run tests with Matplotlib & CodeCov on latest Python version
- name: Test with pytest including Matplotlib & Codecov
if: ${{ matrix.python-version == '3.12' }}
run: poetry run pytest tests --mpl --cov=./ --cov-report=xml
# run tests with Matplotlib & CodeCov on latest Python version
- name: Test with pytest including Matplotlib & Codecov
if: ${{ matrix.python-version == '3.12' }}
run: poetry run pytest tests --mpl --cov=./ --cov-report=xml

- name: Upload coverage report to Codecov
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' }}
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
env_vars: ${{ matrix.os }} py${{ matrix.python-version }}
- name: Upload coverage report to Codecov
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' }}
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
env_vars: ${{ matrix.os }} py${{ matrix.python-version }}
57 changes: 38 additions & 19 deletions README.md
Expand Up @@ -69,6 +69,44 @@ for more information about the pyam data model
or look at the [data-table tutorial](https://pyam-iamc.readthedocs.io/en/stable/tutorials/data_table_formats.html)
to see how to cast from a variety of timeseries formats to a **pyam.IamDataFrame**.

Installation
------------

### pip

> [!WARNING]
> The **pyam** package is distributed on https://pypi.org under the name **pyam-iamc**.
https://pypi.org/project/pyam-iamc/

Please install using
```
pip install pyam-iamc
```

### conda

https://anaconda.org/conda-forge/pyam

Please install using
```
conda install pyam
```

### install from source

To install from source (including all dependencies) after cloning this repository, run

```
pip install --editable .[tests,optional_io_formats,tutorials]
```

To check that the package was installed correctly, run

```
pytest tests
```

Tutorials
---------

Expand Down Expand Up @@ -142,22 +180,3 @@ Copyright 2017-2024 IIASA and the pyam developer team
The **pyam** package is licensed
under the Apache License, Version 2.0 (the "License");
see [LICENSE](LICENSE) and [NOTICE](NOTICE.md) for details.

Install
-------

For basic instructions,
please [read the docs](https://pyam-iamc.readthedocs.io/en/stable/install.html)!

To install from source (including all dependencies)
after cloning this repository, simply run

```
pip install --editable .[tests,optional_io_formats,tutorials]
```

To check that the package was installed correctly, run

```
pytest tests
```
4 changes: 2 additions & 2 deletions docs/install.rst
Expand Up @@ -38,6 +38,6 @@ Dependencies
Like any software project, we stand on the shoulders of giants. Our particular
giants include **pandas** (https://pandas.pydata.org),
**matplotlib** (https://matplotlib.org), and **numpy** (https://numpy.org).
See the `setup configuration`_ for more information.
See the `pyproject.toml`_ for more information.

.. _`setup configuration`: https://github.com/IAMconsortium/pyam/blob/main/setup.cfg
.. _`pyproject.toml`: https://github.com/IAMconsortium/pyam/blob/main/pyproject.toml

0 comments on commit 52cb754

Please sign in to comment.