Skip to content

Commit

Permalink
Merge pull request #6 from dag-hammarskjold-library/20240821
Browse files Browse the repository at this point in the history
activate.sh; cleanup
  • Loading branch information
jbukhari authored Sep 24, 2024
2 parents ca7d802 + f01665b commit 609b523
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ celerybeat.pid
.env
.venv
env/
venv/
venv*
ENV/
env.bak/
venv.bak/
Expand Down
3 changes: 3 additions & 0 deletions activate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Shortcut for activating any venv found in the current dir. Run using `source activate.sh`

source $(find . | grep -E "^./v?env.*/bin/activate$")
1 change: 1 addition & 0 deletions package/module.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# module

class Class():
def __init__(self):
Expand Down
9 changes: 8 additions & 1 deletion package/scripts/script.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# This is meant to be run from the command line. It can be configured to be
# installed as a CLI command using the 'entry_points' parameter in setup.py

import sys
from argparse import ArgumentParser
Expand All @@ -14,4 +16,9 @@ def run():
c = Class()
c.hello_world()

return
return

###

if __name__ == '__main__':
run()
2 changes: 1 addition & 1 deletion package/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# set up pytest fixtures
# here https://docs.pytest.org/en/7.1.x/reference/fixtures.html#conftest-py-sharing-fixtures-across-multiple-files
# https://docs.pytest.org/en/8.2.x/explanation/fixtures.html#about-fixtures

import pytest

Expand Down
1 change: 1 addition & 0 deletions package/tests/test_module.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import pytest

def test_module():
return
2 changes: 1 addition & 1 deletion package/tests/test_scripts.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import sys
import sys, pytest
from package.scripts import script

def test_script():
Expand Down

0 comments on commit 609b523

Please sign in to comment.