Skip to content
This repository was archived by the owner on Sep 3, 2022. It is now read-only.

Commit 4b6e12a

Browse files
authoredMar 28, 2017
Update PyPI release script (#326)
Updated the package release script to compile *.ts to *.js, and actually submit them to testpypi (or pypi). Also got rid of the timestamp on the version string, we should be uploading easy to use version strings since those are used manually by users in pip commands.
1 parent 9fdc87d commit 4b6e12a

File tree

2 files changed

+33
-17
lines changed

2 files changed

+33
-17
lines changed
 

‎release.sh

+32-14
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,38 @@
1-
#!/bin/sh -e
2-
3-
# Copyright 2016 Google Inc. All rights reserved.
1+
#!/bin/bash -e
2+
# Copyright 2017 Google Inc. All rights reserved.
43
#
5-
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
6-
# in compliance with the License. You may obtain a copy of the License at
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
77
#
8-
# http://www.apache.org/licenses/LICENSE-2.0
8+
# http://www.apache.org/licenses/LICENSE-2.0
99
#
10-
# Unless required by applicable law or agreed to in writing, software distributed under the License
11-
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12-
# or implied. See the License for the specific language governing permissions and limitations under
13-
# the License.
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
# Compiles the typescript sources to javascript and submits the files
17+
# to the pypi server specified as first parameter, defaults to testpypi
18+
# In order to run this script locally, make sure you have the following:
19+
# - Typescript installed
20+
# - A configured ~/.pypi.rc containing your pypi/testpypi credentials with
21+
# the server names matching the name you're passing in.
22+
# - Make sure the package version string in the setup.py file is updated.
23+
# It will get rejected by the server if it already exists
24+
# - If this is a new release, make sure the release notes are updated
25+
# and create a new release tag
26+
27+
tsc --module amd --noImplicitAny datalab/notebook/static/*.ts
28+
tsc --module amd --noImplicitAny google/datalab/notebook/static/*.ts
1429

15-
# Build a distribution package
16-
tsc --module amd --noImplicitAny --outdir datalab/notebook/static datalab/notebook/static/*.ts
17-
python setup.py bdist_wheel
18-
rm datalab/notebook/static/*.js
30+
server="${1:-testpypi}"
31+
echo "Submitting package to ${server}"
1932

33+
# Build and upload a distribution package
34+
python setup.py sdist upload -r "${server}" -q
2035

36+
# Clean up
37+
rm -f datalab/notebook/static/*.js
38+
rm -f google/datalab/notebook/static/*.js

‎setup.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@
1212

1313
# To publish to PyPi use: python setup.py bdist_wheel upload -r pypi
1414

15-
import datetime
1615
from setuptools import setup
1716

18-
minor = datetime.datetime.now().strftime("%y%m%d%H%M")
19-
version = '1.0.' + minor
17+
version = '1.0.0'
2018

2119
setup(
2220
name='datalab',

0 commit comments

Comments
 (0)
This repository has been archived.