Skip to content

Commit f2ee71a

Browse files
committed
Prepare for deprecated distribution names final releases
1 parent 32f4eda commit f2ee71a

10 files changed

Lines changed: 102 additions & 47 deletions

File tree

deprecated/MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
exclude README.md

deprecated/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Final Releases of Deprecated PyPI Package Names
2+
3+
In this current directory, use the `setup.py` script to complete the release
4+
(e.g. `python3 setup.py {sdist, bdist_wheel}`, etc), as documented in the
5+
standard [release procedures](../release_procedure.md), after having set
6+
`package_name` appropriately in the script (using commenting-in/out).
Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2020 NVIDIA. All Rights Reserved.
1+
# Copyright 2023 NVIDIA Corporation. All Rights Reserved.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -17,7 +17,17 @@
1717
from __future__ import division
1818
from __future__ import print_function
1919

20-
from .version import __version__
21-
from .warning import message
20+
distribution_name = "framework-determinism"
2221

23-
print(message)
22+
version = "0.1.0"
23+
24+
long_description = """
25+
The `framework-determinism` PyPI distribution has been deprecated and the
26+
`fwd9m` package in this distribution contains no code.
27+
28+
Please install the latest version of the
29+
[framework-reproducibility](https://pypi.org/project/framework-reproducibility/)
30+
PyPI distribution.
31+
"""
32+
33+
print(long_description)

deprecated/setup.py

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Copyright 2020-2023 NVIDIA Corporation. All Rights Reserved
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
# ========================================================================
15+
16+
import importlib
17+
import setuptools
18+
19+
# package_name = 'fwd9m'
20+
package_name = 'tfdeterminism'
21+
22+
print("PACKAGE IMPORT WARNING (expected):")
23+
package = importlib.import_module(package_name)
24+
25+
description = ("Providing reproducibility in deep learning frameworks")
26+
url = "https://github.com/NVIDIA/%s" % package.distribution_name
27+
28+
print("Now running setuptools.setup()")
29+
30+
# Note that using python 3.6 (i.e. via the `python3.6` executable) results in
31+
# the long_description_content_type being ignored.
32+
# For more info, see https://github.com/di/markdown-description-example/issues/4
33+
34+
setuptools.setup(
35+
name = package.distribution_name,
36+
version = package.version,
37+
packages = [package_name],
38+
url = url,
39+
license = 'Apache 2.0',
40+
author = 'NVIDIA',
41+
author_email = 'duncan@nvidia.com',
42+
description = description,
43+
long_description = package.long_description,
44+
long_description_content_type = 'text/markdown',
45+
install_requires = [],
46+
classifiers = [],
47+
keywords = [],
48+
platforms = []
49+
)
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2020 NVIDIA Corporation. All Rights Reserved
1+
# Copyright 2023 NVIDIA Corporation. All Rights Reserved.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -13,16 +13,21 @@
1313
# limitations under the License.
1414
# ========================================================================
1515

16-
message = """
17-
WARNING:
16+
from __future__ import absolute_import
17+
from __future__ import division
18+
from __future__ import print_function
1819

19-
framework-determinism version 0.0.0 is a placeholder distribution that is
20-
intended only to reserve the distribution name in the Python Package Index
21-
(PyPI).
20+
distribution_name = "tensorflow-determinism"
2221

23-
The fwrepro package has not yet been populated in this PyPI distribution.
24-
Install a newer version of this distribution (if one now exists) or install the
25-
latest version of the tensorflow-determinism PyPI distribution, which is the
26-
distribution that will evolve (or has evolved) into the framework-determinism
22+
version = "0.4.0"
23+
24+
long_description = """
25+
The `tensorflow-determinism` PyPI distribution has been deprecated and the
26+
`tfdeterminism` package in this distribution contains no code.
27+
28+
Please install the latest version of the
29+
[framework-reproducibility](https://pypi.org/project/framework-reproducibility/)
2730
PyPI distribution.
2831
"""
32+
33+
print(long_description)

fwd9m_reserve/version.py

Lines changed: 0 additions & 16 deletions
This file was deleted.

fwr13y/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2020 NVIDIA. All Rights Reserved.
1+
# Copyright 2020 NVIDIA Corporation. All Rights Reserved.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

fwr13y/d9m/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2022 NVIDIA. All Rights Reserved.
1+
# Copyright 2022 NVIDIA Corporation. All Rights Reserved.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

release_procedure.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ are to be excluded from the distribution (e.g. via `MANIFEST.in` or the
5252
`python3 setup.py sdist`, otherwise the exluded items will remain.
5353

5454
Note that to install the source distribution, the user will need to have `pip`
55-
installed a new-enough version of `setuptools` and also `wheel`.
55+
installed, a new-enough version of `setuptools` and also `wheel`.
5656

5757
## 6. Create a Universal Wheel
5858

@@ -112,6 +112,19 @@ venv/bin/pip install -i https://test.pypi.org/pypi/ framework-reproducibility
112112
rm -rf venv
113113
```
114114

115+
A couple of notes related to the PyPI server functionality, as observed from
116+
playing with the test server:
117+
118+
1. You have to upload the source distribution (the `.tar.gz` file) before the
119+
wheel in order for the description to be intepreted as markdown. Presumably,
120+
the source format is not been into the wheel, at least in the way it's created
121+
here, and once it's been set for a given version it cannot be changed.
122+
123+
2. It can take a few minutes for the versioning seen by `pip` to be updated. So
124+
waiting for a few minutes can resolve issues where it seems that the latest
125+
version is not yet available to install, even though you can see it should be
126+
availble according to the web page for the distribution.
127+
115128
### 7b. Real PyPI Server
116129

117130
```

setup.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import os
1818

1919
distribution_name = 'framework-reproducibility'
20-
# package_name = 'fwrepro' + '_reserve'
2120
package_name = 'fwr13y'
2221

2322
# This file needs to be executed during installation. It's not possible to
@@ -27,12 +26,8 @@
2726
import sys
2827
sys.path.append(package_name)
2928
from version import __version__ as version
30-
# from warning import message as warning_message
3129
sys.path.remove(package_name)
3230

33-
# if warning_message:
34-
# long_description = warning_message
35-
# else:
3631
readme = os.path.join(os.path.dirname(os.path.realpath(__file__)),
3732
"pypi_description.md")
3833
with open(readme, "r") as fp:
@@ -55,18 +50,10 @@
5550
"variance-reduction atomics ngc gpu-determinism deterministic-ops "
5651
"frameworks gpu-support d9m r13y fwr13y")
5752

58-
# `find_packages(exclude=['fwd9m_reserve'])` is used instead of adding
59-
# `exclude fwd9m_reserve/*` to `MANIFEST.in` because even though `MANIFEST.in`
60-
# is attended to in the creation of the source distribution, it is ignored in
61-
# the creation of the wheel. Folks generally seem to think that
62-
# `include_package_data=True` is needed to make the exclusions from the contents
63-
# of the wheel match those of the source distribution, but it doesn't seem to
64-
# make any difference.
65-
6653
setup(
6754
name = distribution_name,
6855
version = version,
69-
packages = find_packages(exclude=['fwd9m_reserve']),
56+
packages = ['fwr13y'],
7057
url = url,
7158
license = 'Apache 2.0',
7259
author = 'NVIDIA',

0 commit comments

Comments
 (0)