Skip to content

Commit ef3578e

Browse files
Thinh Nguyenguzman-raphael
andauthored
Apply suggestions from code review
Co-authored-by: Raphael Guzman <38401847+guzman-raphael@users.noreply.github.com>
1 parent 1cbc62a commit ef3578e

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

.github/workflows/development.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
- uses: actions/checkout@v2
4747
- name: Compile image
4848
run: |
49-
export PKG_NAME=$(echo ${PWD##*/} | sed 's|-|_|g')
49+
export PKG_NAME=$(python3 -c "print([p for p in __import__('setuptools').find_packages() if '.' not in p][0])")
5050
export PKG_VERSION=$(cat ${PKG_NAME}/version.py | awk -F\' '/__version__ = / {print $2}')
5151
export HOST_UID=$(id -u)
5252
docker-compose -f docker-compose-build.yaml up --exit-code-from element --build
@@ -84,8 +84,9 @@ jobs:
8484
- uses: actions/checkout@v2
8585
- name: Determine package version
8686
run: |
87-
SDIST_PKG_NAME=${PWD##*/}
88-
PKG_NAME=$(echo ${PWD##*/} | sed 's|-|_|g')
87+
PKG_NAME=$(python3 -c "print([p for p in __import__('setuptools').find_packages() if '.' not in p][0])")
88+
SDIST_PKG_NAME=$(echo ${PKG_NAME} | sed 's|_|-|g')
89+
8990
PKG_VERSION=$(cat ${PKG_NAME}/version.py | awk -F\' '/__version__ = / {print $2}')
9091
echo "PKG_NAME=${PKG_NAME}" >> $GITHUB_ENV
9192
echo "PKG_VERSION=${PKG_VERSION}" >> $GITHUB_ENV

docker-compose-build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# PY_VER=3.8 IMAGE=djbase DISTRO=alpine PKG_NAME=$(echo ${PWD##*/} | sed 's|-|_|g') PKG_VERSION=$(cat ${PKG_NAME}/version.py | awk -F\' '/__version__/ {print $2}') HOST_UID=$(id -u) docker-compose -f docker-compose-build.yaml up --exit-code-from element --build
1+
# PY_VER=3.8 IMAGE=djbase DISTRO=alpine PKG_NAME=$(python -c "print([p for p in __import__('setuptools').find_packages() if '.' not in p][0])") PKG_VERSION=$(cat ${PKG_NAME}/version.py | awk -F\' '/__version__/ {print $2}') HOST_UID=$(id -u) docker-compose -f docker-compose-build.yaml up --exit-code-from element --build
22
#
33
# Intended for updating dependencies and docker image.
44
# Used to build release artifacts.

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from setuptools import setup, find_packages
22
from os import path
33

4-
pkg_name = 'element-array-ephys'
4+
pkg_name = [p for p in find_packages() if '.' not in p][0]
55
here = path.abspath(path.dirname(__file__))
66

77
with open(path.join(here, 'README.md'), 'r') as f:
@@ -10,11 +10,11 @@
1010
with open(path.join(here, 'requirements.txt')) as f:
1111
requirements = f.read().splitlines()
1212

13-
with open(path.join(here, pkg_name.replace('-', '_'), 'version.py')) as f:
13+
with open(path.join(here, pkg_name, 'version.py')) as f:
1414
exec(f.read())
1515

1616
setup(
17-
name=pkg_name,
17+
name=pkg_name.replace('_', '-'),
1818
version=__version__,
1919
description="DataJoint Element for Extracellular Array Electrophysiology",
2020
long_description=long_description,

0 commit comments

Comments
 (0)