Skip to content

Commit

Permalink
iopath ci
Browse files Browse the repository at this point in the history
Summary:
Small changes to iopath CI
-Add conda build for python 3.9
-Make both conda and pip build on every commit (for future use in automating uploads)
-remove the date from the conda package name
-move the version number definition to a separate file so it is easier to read programmatically.

Reviewed By: sujitoc

Differential Revision: D26956064

fbshipit-source-id: 556f8278e79b0ef208e317b2fe826f5429d31b7f
  • Loading branch information
bottler authored and facebook-github-bot committed Mar 11, 2021
1 parent ac62c2f commit e68b69d
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 24 deletions.
14 changes: 13 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
paths:
- "*"

build_conda:
build_conda_and_pip:
docker:
- image: continuumio/miniconda3
steps:
Expand All @@ -114,11 +114,23 @@ jobs:
fi
conda install conda-build
bash packaging/build_all_conda.sh
- run:
name: Build Pip Package
command: |
# no commits in the last 25 hours
if [[ -z $(git log --since="25 hours ago") ]]; then
echo "No commits in the last day."
exit 0
fi
python setup.py bdist_wheel
- store_artifacts:
path: packaging/output_files
- store_artifacts:
path: dist

workflows:
version: 2
regular_test:
jobs:
- tests
- build_conda_and_pip
7 changes: 3 additions & 4 deletions iopath/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@
TabularUriParser,
)

from .version import __version__

__all__ = [
"LazyPath",
"PathManager",
"get_cache_dir",
"file_lock",
"TabularPathHandler",
"TabularUriParser",
__version__,
]

# This line will be programatically read/write by setup.py.
# Leave them at the bottom of this file and don't touch them.
__version__ = "0.1.6"
1 change: 1 addition & 0 deletions iopath/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.1.6"
4 changes: 2 additions & 2 deletions packaging/build_all_conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
set -ex

for PV in 3.6 3.7 3.8
for PV in 3.6 3.7 3.8 3.9
do
PYTHON_VERSION=$PV bash packaging/build_conda.sh
done

ls -Rl packaging

for version in 36 37 38
for version in 36 37 38 39
do
(cd packaging/out && conda convert -p win-64 linux-64/iopath-*-py$version.tar.bz2)
(cd packaging/out && conda convert -p osx-64 linux-64/iopath-*-py$version.tar.bz2)
Expand Down
6 changes: 3 additions & 3 deletions packaging/build_conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ set -ex

mkdir -p packaging/out

version=$(python -c "exec(open('iopath/__init__.py').read()); print(__version__)")
build_version=$version.post$(date +%Y%m%d)
version=$(python -c "exec(open('iopath/version.py').read()); print(__version__)")
# build_version=$version.post$(date +%Y%m%d)

export BUILD_VERSION=$build_version
export BUILD_VERSION=$version

if [[ "3.6" == "$PYTHON_VERSION" ]]
then
Expand Down
17 changes: 3 additions & 14 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,15 @@
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.

from os import path
import runpy

from setuptools import find_packages, setup


def get_version():
init_py_path = path.join(
path.abspath(path.dirname(__file__)), "iopath", "__init__.py"
)
init_py = open(init_py_path, "r").readlines()
version_line = [line.strip() for line in init_py if line.startswith("__version__")][
0
]
version = version_line.split("=")[-1].strip().strip("'\"")

return version

version = runpy.run_path("iopath/version.py")["__version__"]

setup(
name="iopath",
version=get_version(),
version=version,
author="FAIR",
license="MIT licensed, as found in the LICENSE file",
url="https://github.com/facebookresearch/iopath",
Expand Down

0 comments on commit e68b69d

Please sign in to comment.