Skip to content

Commit

Permalink
Modernize build syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
LevN0 committed Aug 10, 2024
1 parent 66c2e69 commit 388a03a
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 33 deletions.
48 changes: 23 additions & 25 deletions .github/workflows/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:

- name: Install dependencies
run: |
pip install tox
pip install tox-gh-actions
python -m pip install tox
python -m pip install tox-gh-actions
- name: Test Code
run: tox
Expand All @@ -55,11 +55,11 @@ jobs:
shell: bash
run: |
if [[ ${{ matrix.python-version }} == 3.3* ]]; then
pip install virtualenv==15.2.0
pip install pluggy==0.5.2
pip install tox==2.9.1
python -m pip install virtualenv==15.2.0
python -m pip install pluggy==0.5.2
python -m pip install tox==2.9.1
fi
pip install tox
python -m pip install tox
- name: Test Code
shell: bash
Expand All @@ -85,8 +85,8 @@ jobs:

- name: Install dependencies
run: |
pip install tox
pip install tox-gh-actions==2.8.1
python -m pip install tox
python -m pip install tox-gh-actions==2.8.1
- name: Test Code
run: tox
Expand All @@ -105,13 +105,13 @@ jobs:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: '3.9'
python-version: '3.11'

- name: Install dependencies
run: |
pip install numpy
pip install sphinx
pip install numpydoc
python -m pip install numpy
python -m pip install sphinx
python -m pip install numpydoc
- name: Test Docs
run: sphinx-build -W --keep-going doc _build/html
Expand All @@ -132,28 +132,27 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
python-version: '3.11'

- name: Install dependencies
run: |
pip install wheel
pip install numpy
pip install sphinx
pip install numpydoc
python -m pip install build
python -m pip install numpy
python -m pip install sphinx
python -m pip install numpydoc
- name: Create artifacts
run: |
python setup.py sdist --formats=zip
python setup.py bdist_wheel
python -m build
VERSION=$(python setup.py --version)
sphinx-build -W --keep-going doc _build/html
tar -C _build/html -zcf dist/docs-${VERSION}.tar.gz .
- name: Save artifacts to Github Actions
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: docs, source zip, wheel
name: docs, source tar, wheel
path: dist/*
if-no-files-found: error

Expand Down Expand Up @@ -226,16 +225,15 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
python-version: '3.11'

- name: Install dependencies
run: |
pip install wheel
python -m pip install build
- name: Create artifacts
run: |
python setup.py sdist --formats=zip
python setup.py bdist_wheel
python -m build
- name: Publish to Test PyPI
uses: pypa/[email protected]
Expand Down
11 changes: 5 additions & 6 deletions BUILDING
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ Building PDS4 Tools:

Using Python 3, from the directory containing setup.py for pds4_tools, run:

pip install wheel
python setup.py sdist --formats=zip
python setup.py bdist_wheel
python -m pip install build
python -m build

This will make a compressed distribution inside the 'dist' directory.

Expand All @@ -33,10 +32,10 @@ Building PDS4 Tools:
5) Upload to PyPi via,

Setup a ~/.pypirc file for both PyPi and TestPyPi. See:
https://packaging.python.org/guides/migrating-to-pypi-org/
https://packaging.python.org/en/latest/specifications/pypirc/#common-configurations

pip install twine
twine upload dist/pds4_tools-xx.zip
python -m pip install twine
twine upload dist/pds4_tools-xx.tar.gz
twine upload dist/pds4_tools-xx-py2.py3-none-any.whl

You may append '-r testpypi' to the last two commands to upload to the test PyPi
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
license_file = LICENSES
description-file = README.rst
license_files = LICENSES
description_file = README.rst

[bdist_wheel]
universal = 1
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def get_docs_url():

description='Package to read and display NASA PDS4 data',
long_description=read('README.rst'),
long_description_content_type='text/x-rst',

author=about['__author__'],
author_email=about['__email__'],
Expand Down

0 comments on commit 388a03a

Please sign in to comment.