Skip to content

Commit

Permalink
chore: merge main into branch to resolve merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
davhofer committed Sep 11, 2024
2 parents 4a9afab + 957b484 commit 10692c8
Show file tree
Hide file tree
Showing 162 changed files with 2,639 additions and 6,329 deletions.
162 changes: 162 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Docker image used for performing installation tests with GitHub Actions
FROM python:3.12

# Install system dependencies
Expand Down
49 changes: 28 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# py2spack: Automating conversion of standard python packages to Spack package recipes

Github repository for the CSCS internship project with the goal of developing a Python tool for automatically generating Spark package recipes based on existing Python packages, with the ability to handle direct and transitive dependencies and flexible versions.
Github repository for the CSCS internship project with the goal of developing a Python tool for automatically generating Spack package recipes based on existing Python packages, with the ability to handle direct and transitive dependencies and flexible versions.

For more information, see the [Wiki](https://github.com/davhofer/py2spack/wiki).
For more information, see the [Documentation](#Documentation).

## Installation

Expand Down Expand Up @@ -33,10 +33,7 @@ The package is still in development and not yet published to PyPI. It can howeve
## Usage

```
usage: py2spack [-h] [--max-conversions MAX_CONVERSIONS]
[--versions-per-package VERSIONS_PER_PACKAGE]
[--repo REPO] [--ignore [IGNORE ...]] [--testing]
package
usage: py2spack [-h] [--max-conversions MAX_CONVERSIONS] [--versions-per-package VERSIONS_PER_PACKAGE] [--repo REPO] [--allow-duplicate] package [--ignore [IGNORE ...]]
CLI for converting a python package and its dependencies to Spack.
Expand All @@ -48,16 +45,11 @@ options:
--max-conversions MAX_CONVERSIONS
Maximum number of packages that are converted
--versions-per-package VERSIONS_PER_PACKAGE
Versions per package to be downloaded and
converted
--repo REPO Name of or full path to local Spack
repository where packages should be saved
Versions per package to be downloaded and converted
--repo REPO Name of or full path to local Spack repository where packages should be saved
--ignore [IGNORE ...]
List of packages to ignore. Must be specified
last (after <package> argument) for the
command to work
--testing For testing purposes; adds the prefix 'test-'
when saving packages
List of packages to ignore. Must be specified last (after <package> argument) for the command to work
--allow-duplicate Convert the package, even if a package of the same name already exists in some Spack repo. Will NOT overwrite the existing package. Only applies to the main package to be converted, not to dependencies.
```

### Conversion from PyPI
Expand All @@ -80,16 +72,31 @@ py2spack user/package-name

> NOTE: dependencies will always be resolved through PyPI, even when converting a package from GitHub
## Running tests
## Documentation

After installing the package, the tests can be run from the project root directory as follows:
To check out the detailed documentation (API docs, usage, implementation, package conversion, etc.), you need to clone the repository and build the docs:

```bash
pip install .[docs]
cd docs; make html
```

You can then browse it locally, e.g.

```bash
firefox _build/html/index.html
```

## Testing

After installing the package with the `tests` option, the tests can be run from the project root directory as follows:

```bash
python -m pytest
```

## Important links
Installation tests for converted packages are run through GitHub Actions in a Docker container, see `.github/workflows/run-installation-tests.yaml`.

## Author

- [Detailed Project Description](<CSCS Internship Project Description.md>)
- [Wiki](https://github.com/davhofer/py2spack/wiki)
- [Changelog](CHANGELOG.md)
Created by David Hofer ([davhofer](https://github.com/davhofer), `davhofer [at] ethz [dot] ch`) during an internship at [CSCS](https://www.cscs.ch/).
2 changes: 2 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
_build/
apidocs/
27 changes: 27 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

# raise warnings to errors
html-strict:
@$(SPHINXBUILD) -b html -nW --keep-going "$(SOURCEDIR)" "$(BUILDDIR)/html" $(SPHINXOPTS) $(O)

clean:
rm -r $(BUILDDIR)
Binary file added docs/_static/images/favicon.ico
Binary file not shown.
61 changes: 61 additions & 0 deletions docs/_static/images/spack-logo-white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 10692c8

Please sign in to comment.