Skip to content

Commit

Permalink
fix scripts metadata to include strun as a standalone Python scri…
Browse files Browse the repository at this point in the history
…pt in package (#76)

* fix `scripts` metadata to include `strun` as a standalone Python script in package

* add change log entry

* test scripts are installed
  • Loading branch information
zacharyburnett authored Dec 16, 2022
1 parent e29d9d3 commit 0f6f03d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
0.4.4 (unreleased)
=================

-
- include `scripts` in package [#76]

0.4.3 (2022-12-15)
==================
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ test = [

[project.entry-points]
asdf_extensions = { stpipe = 'stpipe.integration:StpipeExtension' }
console_scripts = { stpipe = 'stpipe.cli.main:main' }

[project.scripts]
stpipe = 'stpipe.cli.main:main'

[build-system]
requires = [
Expand Down
11 changes: 11 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from pathlib import Path

from setuptools import setup

scripts = [
str(filename)
for filename in Path('./scripts').glob('**/*')
if filename.is_file() and filename.name != '__pycache__'
]

setup(scripts=scripts)
8 changes: 8 additions & 0 deletions tests/test_scripts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import shutil

SCRIPTS = ['strun']


def test_scripts_in_path():
for script in SCRIPTS:
assert shutil.which(script) is not None, f'`{script}` not installed'

0 comments on commit 0f6f03d

Please sign in to comment.