diff --git a/.conda/meta.yaml b/.conda/meta.yaml new file mode 100644 index 0000000..9da7328 --- /dev/null +++ b/.conda/meta.yaml @@ -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 diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index 87179db..3e40bb1 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -1,4 +1,4 @@ -name: Publish Python +name: Publish PyPI on: push: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 547021c..673c7dd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 diff --git a/README.rst b/README.rst index 30cbb4e..d1b47e2 100644 --- a/README.rst +++ b/README.rst @@ -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