File tree 4 files changed +27
-16
lines changed
4 files changed +27
-16
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,6 @@ function setup
121
121
{
122
122
ARGS=" $* "
123
123
rm -rf ${DIST} 2> /dev/null
124
- set_metadata_and_setup " neo4j-driver" " True" ${ARGS} # Legacy package; can be removed in 2.0
124
+ set_metadata_and_setup " neo4j-driver" " True" ${ARGS} --sdist # Legacy package; can be removed in 2.0
125
125
set_metadata_and_setup " neo4j" " False" ${ARGS}
126
126
}
Original file line number Diff line number Diff line change 11
11
exit 1
12
12
else
13
13
source " ${ROOT} /bin/dist-functions"
14
- setup " ${VERSION} " --sdist
14
+ setup " ${VERSION} "
15
15
fi
Original file line number Diff line number Diff line change @@ -24,13 +24,25 @@ for PACKAGE in "neo4j-driver" "neo4j"; do
24
24
NORMALIZED_PACKAGE=" $( normalize_dist_name " $PACKAGE " ) "
25
25
if check_file " ${DIST} /${NORMALIZED_PACKAGE} -${VERSION} .tar.gz"
26
26
then
27
- TWINE_ARGS=" ${TWINE_ARGS} ${DIST} /${NORMALIZED_PACKAGE} -${VERSION} .tar.gz"
27
+ TWINE_ARGS=" ${TWINE_ARGS} ${DIST} /${NORMALIZED_PACKAGE} -${VERSION} .tar.gz"
28
28
elif check_file " ${DIST} /${PACKAGE} -${VERSION} .tar.gz" ; then
29
- TWINE_ARGS=" ${TWINE_ARGS} ${DIST} /${PACKAGE} -${VERSION} .tar.gz"
29
+ TWINE_ARGS=" ${TWINE_ARGS} ${DIST} /${PACKAGE} -${VERSION} .tar.gz"
30
30
else
31
- echo " Distribution file for ${PACKAGE} not found"
32
- exit 1
31
+ echo " Source distribution file for ${PACKAGE} not found"
32
+ exit 1
33
33
fi
34
34
done
35
35
36
+ NORMALIZED_PACKAGE=" $( normalize_dist_name " neo4j" ) "
37
+ if check_file " ${DIST} /${NORMALIZED_PACKAGE} -${VERSION} -py3-none-any.whl"
38
+ then
39
+ TWINE_ARGS=" ${TWINE_ARGS} ${DIST} /${NORMALIZED_PACKAGE} -${VERSION} -py3-none-any.whl"
40
+ elif check_file " ${DIST} /${PACKAGE} -${VERSION} -py3-none-any.whl" ; then
41
+ TWINE_ARGS=" ${TWINE_ARGS} ${DIST} /${PACKAGE} -${VERSION} -py3-none-any.whl"
42
+ else
43
+ echo " Wheel distribution file for ${PACKAGE} not found"
44
+ exit 1
45
+ fi
46
+
47
+
36
48
twine upload ${TWINE_ARGS}
Original file line number Diff line number Diff line change 58
58
""" + readme
59
59
60
60
61
- @contextmanager
62
- def changed_package_name (new_name ):
61
+ def change_project_name (new_name ):
63
62
with open ("pyproject.toml" , "a+" ) as fd :
64
63
fd .seek (0 )
65
64
pyproject = tomlkit .parse (fd .read ())
@@ -68,16 +67,16 @@ def changed_package_name(new_name):
68
67
fd .seek (0 )
69
68
fd .truncate ()
70
69
tomlkit .dump (pyproject , fd )
70
+ return old_name
71
71
72
- yield
73
72
74
- with open ( "pyproject.toml" , "a+" ) as fd :
75
- fd . seek ( 0 )
76
- pyproject = tomlkit . parse ( fd . read () )
77
- pyproject [ "project" ][ "name" ] = old_name
78
- fd . seek ( 0 )
79
- fd . truncate ()
80
- tomlkit . dump ( pyproject , fd )
73
+ @ contextmanager
74
+ def changed_package_name ( new_name ):
75
+ old_name = change_project_name ( new_name )
76
+ try :
77
+ yield
78
+ finally :
79
+ change_project_name ( old_name )
81
80
82
81
83
82
with changed_package_name (package ):
You can’t perform that action at this time.
0 commit comments