Skip to content

Commit

Permalink
Fixes broken tar.gz distribution (#52)
Browse files Browse the repository at this point in the history
* Fixes broken tar.gz distribution
* Add artifacts to Github action for debugging
* Separate build and publish step
* Install packaging dependencies also when not on master
* Fail explicitly if README is missing
  • Loading branch information
bartbroere authored Feb 25, 2022
1 parent 8f9763f commit 55881d6
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 16 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,20 @@ jobs:
draft: false
prerelease: false
- name: Install publishing dependencies
if: github.ref == 'refs/heads/master'
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
python -m pip install setuptools wheel twine
- name: Build
run: |
python setup.py sdist bdist_wheel
- name: Publish to PyPI
if: github.ref == 'refs/heads/master'
env:
TWINE_USERNAME: fbda
TWINE_PASSWORD: ${{ secrets.PYPI_FBDA_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
- uses: actions/upload-artifact@v2
with:
name: Distribution files
path: dist/*
File renamed without changes.
9 changes: 4 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
matplotlib
numpy
scipy
scikit-learn
tqdm
--editable .
# The list of dependencies moved to setup.py
# The editable flag ensures pip install -r requirements.txt still works
# Changes while developing lir are immediately reflected in the Python environment in editable mode
16 changes: 9 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import os
from setuptools import setup, find_packages

package_dir = os.path.dirname(__file__)
requirements_file_path = os.path.join(package_dir, "requirements.txt")
with open(requirements_file_path, "r") as f:
packages = [str(f) for f in f.readlines()]
with open("readme.md") as f:
with open("README.md") as f:
long_description = f.read()

setup(
name="lir",
version="0.1.4",
Expand All @@ -19,7 +15,13 @@
packages=find_packages(),
setup_requires=["nose"],
test_suite="nose.collector",
install_requires=packages,
install_requires=[
"matplotlib",
"numpy",
"scipy",
"scikit-learn",
"tqdm",
],
classifiers=[
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3 :: Only",
Expand Down

0 comments on commit 55881d6

Please sign in to comment.