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

Switch packaging to pyproject.toml #429

Merged
merged 4 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,15 @@ jobs:
python-version: ['3.10']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python setup.py develop
pip install pytest-benchmark
python -m pip install .[tests]
- name: Benchmark with pytest
run: |
pytest tests/test_db_benchmark.py --benchmark-json output.json
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/coveralls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,16 @@ jobs:
python-version: ['3.10']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python -m pip install --editable .
python -m pip install flake8
python -m pip install --editable .[tests]
cd tests/cannonsim/src; make; cd ../../..
pip install pytest-cov
pip install coveralls
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/pdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,15 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python -m pip install --editable .
python -m pip install --editable .[docs]
cd tests/cannonsim/src; make; cd ../../..
pip install pdoc
- name: Checkout
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,16 @@ jobs:
python-version: ['3.8', '3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python -m pip install --editable .
python -m pip install flake8
python -m pip install --editable .[tests]
cd tests/cannonsim/src; make; cd ../../..
pip install pytest-cov
pip install coveralls
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,22 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install build twine
- name: Build package
run: python -m build --sdist --wheel
- name: Check package
run: python -m twine check dist/*
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ pep.sh
*.csv
env/
.ipynb_checkpoints/
easyvvuq/_version.py
12 changes: 6 additions & 6 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ sphinx:
# - pdf
# - epub

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
# python:
# install:
# - requirements: docs/requirements.txt
python:
install:
- method: pip
path: .
extra_requirements:
- docs
14 changes: 8 additions & 6 deletions easyvvuq/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@
from . import analysis
from . import comparison

# First make sure python version is 3.6+
assert sys.version_info >= (3, 6), (f"Python version must be >= 3.6,"
f"found {sys.version_info}")
from importlib.metadata import version, PackageNotFoundError

try:
__version__ = version("easyvvuq")
except PackageNotFoundError:
from setuptools_scm import get_version # type: ignore[import]

__version__ = get_version(root="..", relative_to=__file__)

__copyright__ = """

Expand All @@ -36,6 +41,3 @@

"""
__license__ = "LGPL"

from . import _version
__version__ = _version.get_versions()['version']
Loading
Loading