Skip to content

Commit

Permalink
Merge pull request #106 from ekiefl/pypi-size-reduction
Browse files Browse the repository at this point in the history
>100 Mb -> 30 Mb
  • Loading branch information
ekiefl authored Jan 12, 2024
2 parents 218d379 + a6aa882 commit 5a0c301
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
12 changes: 12 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
include pooltool/config/*
include pooltool/config/menus/*.xml

recursive-include pooltool/ani/fonts *.ttf

recursive-include pooltool/ README.md
recursive-include pooltool/ani/camera/states *.json

recursive-include pooltool/logo *
recursive-exclude pooltool/logo *.blend *.svg *.exr

recursive-include pooltool/models *
recursive-exclude pooltool/models *_pbr.glb
recursive-exclude pooltool/models *.blend *.blend1 *.pptx *.svg

recursive-exclude pooltool/models/room *.png *.jpg *.jpeg
recursive-exclude pooltool/models/table *.png *.jpg *.jpeg
recursive-exclude pooltool/models/cue *.png *.jpg *.jpeg
recursive-exclude pooltool/models/balls *.png *.jpg *.jpeg
12 changes: 8 additions & 4 deletions PYPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,41 @@ https://betterscientificsoftware.github.io/python-for-hpc/tutorials/python-pypi-

2. In my development environment, run `python setup.py check`, then `python setup.py sdist`. This creates a tar.gz source distribution in the directory `dist/`

3. Time to upload this distribution to test.pypi. Run `twine upload --repository-url https://test.pypi.org/legacy/ dist/pooltool-billiards-X.X.X.dev0.tar.gz`. Username is ekiefl.
3. Time to upload this distribution to test.pypi. Run `twine upload --repository-url https://test.pypi.org/legacy/ dist/pooltool-billiards-X.X.X.dev0.tar.gz`. Username is __token__ and password is the API token in your keychain under "TestPyPi pooltool".

4. Create a fresh python environment to test the installation

```
source ~/.bashrc
conda deactivate
conda env remove --name asdf
conda create -y -n asdf python=3.8.10
PYTHONPATH=""
conda activate asdf
```

5. Test the installation:
`pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple pooltool-billiards==X.X.X.dev0 --force-reinstall`.

6. Make sure `cd ~; which run_pooltool` leads to the asdf environment: `/Users/evan/anaconda3/envs/asdf/bin/run_pooltool`
Then see if it works: `run_pooltool`
Then see if it works: `run_pooltool`. Additionally, check path of `python -c "import pooltool; print(pooltool.__file__)"`. It should be in site-packages of asdf environment.

7. Change version to X.X.X in `setup.py`, then **back in the development environment** create dist: `python setup.py sdist`

8. Upload to pypi `twine upload dist/pooltool-billiards-X.X.X.tar.gz`
8. Upload to pypi `twine upload dist/pooltool-billiards-X.X.X.tar.gz`. Username is __token__ and password is the API token in your keychain under "PyPi pooltool".

9. Create a new python environment

```
source ~/.bashrc
conda deactivate
conda env remove --name asdf
conda create -y -n asdf python=3.8.10
PYTHONPATH=""
conda activate asdf
cd ~
```

10. Test installation: `pip install pooltool-billiards==X.X.X` (you may need to wait for version to be live)

11. Make a release on github. Run `python setup.py sdist bdist_wheel` and upload the `.whl` and `.tar.gz` found in `dist/`
11. Make a release on github. Run `python setup.py sdist bdist_wheel` **back in the development environment** and upload the `.whl` and `.tar.gz` found in `dist/`
2 changes: 1 addition & 1 deletion pooltool/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.2.1"
__version__ = "0.2.2.1"

import pooltool.ai as ai
import pooltool.ai.aim as aim
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

setup(
name="pooltool-billiards",
version="0.2.1",
version="0.2.2.1",
packages=find_packages(),
scripts=["run_pooltool", "run_pooltool.bat"],
author_email="[email protected]",
Expand Down

0 comments on commit 5a0c301

Please sign in to comment.