Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added meta.yaml file to publish on Anaconda #23

Merged
merged 10 commits into from
Oct 23, 2023
43 changes: 43 additions & 0 deletions .conda/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{% set pyproject = load_file_data('../pyproject.toml', from_recipe_dir=True) %}
package:
name: "{{ pyproject.get('project', {}).get('name') }}"
version: "{{ GIT_DESCRIBE_TAG }}"

source:
git_url: ..

build:
noarch: python
script: {{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation

requirements:
host:
- python{{ pyproject['project']['requires-python'] }}
{% for dep in pyproject['build-system']['requires'] %}
- {{ dep.lower() }}
{% endfor %}

run:
- python{{ pyproject['project']['requires-python'] }}
- pythia8
{% for dep in pyproject['project']['dependencies'] %}
- {{ dep.lower() }}
{% endfor %}

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

about:
home: {{ pyproject['project']['urls']['repository'] }}
summary: {{ pyproject['project']['description'] }}
license: BSD-3-Clause
license_file: LICENSE.txt

extra:
recipe-maintainers:
- jacanchaplais
2 changes: 1 addition & 1 deletion .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Python
name: Publish PyPI

on:
push:
Expand Down
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ repos:
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: check-merge-conflict
- id: debug-statements
Expand Down
39 changes: 15 additions & 24 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,42 +12,33 @@ Ariadne in future releases.
Installation
------------

This package requires Pythia 8 to be installed on your system, and
available in your ``PYTHONPATH``.
Using conda (Recommended)
~~~~~~~~~~~~~~~~~~~~~~~~~

It also requires the ``PYTHIA8DATA`` environment variable to be set.
This is the path to the ``xmldoc/`` directory under Pythia’s ``share``
directory. You can do something like this in your shell config:
The easiest solution is to just install via conda:

.. code:: bash

export PYTHIA8DATA=/home/$USER/pythia82xx/share/Pythia8/xmldoc

Without an existing Pythia installation (using conda)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
conda install -c jacanchaplais showerpipe

If this is not already the case, a very convenient solution is to
install it via ``conda``. This is fast, and automatically sets the
``PYTHIA8DATA`` environment variable when you activate the virtual
environment. An environment file is provided in the root of this repo,
which will install all requirements and then showerpipe, automatically.
The virtual environment can be created using:
Pythia will be included as a dependency, and all relevant paths and
environment variables will be properly set.

.. code:: bash
Using existing Pythia installation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

conda env create -f environment.yml
If Pythia 8 is already installed on your system, and available in your
``PYTHONPATH``, you can just install this package via ``pip``.

If you have an existing conda environment, you can update it by
activating the environment and then using:
It also requires the ``PYTHIA8DATA`` environment variable to be set.
This is the path to the ``xmldoc/`` directory under Pythia’s ``share``
directory. You can do something like this in your shell config:

.. code:: bash

conda env update -f environment.yml --prune

With existing Pythia installation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export PYTHIA8DATA=/home/$USER/pythia82xx/share/Pythia8/xmldoc

Simply:
With everything set up properly, simply run:

.. code:: bash

Expand Down
Loading