Skip to content

Commit

Permalink
setup.py: move requirements to top-level dir
Browse files Browse the repository at this point in the history
as it's the common location and easier to find for new developers.
  • Loading branch information
breznak committed Sep 24, 2019
1 parent c100cfe commit 46514b2
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 9 deletions.
2 changes: 0 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ jobs:
name: Installing python dependencies
command: |
python -m pip install --user --upgrade pip setuptools setuptools-scm wheel
python -m pip install --no-cache-dir --user -r bindings/py/packaging/requirements.txt --verbose || exit
# Build Release with python
- run:
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/htmcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r bindings/py/packaging/requirements.txt
pip install -r requirements.txt
- name: build htmcore with setup.py
run: |
python setup.py install --user
Expand All @@ -49,5 +49,3 @@ jobs:
#TODO 1 Debug build
#TODO GH Releases
#TODO PYPI deploy
#TODO move to top level requirements.txt
#TODO set ARCH_FLAGS (for OSX) in setup.py
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Fork or download the HTM-Community htm.core repository from https://github.com/h
```
cd to-repository-root
python -m pip install --user --upgrade pip setuptools setuptools-scm wheel
python -m pip install --no-cache-dir --user -r bindings/py/packaging/requirements.txt
python -m pip install --no-cache-dir --user -r requirements.txt
```

Be sure you are running the right version of python. Check it with the following command:
Expand Down
3 changes: 1 addition & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ build_script:
- echo Binding version = %BINDINGS_VERSION%

- python -m pip install --user --upgrade pip setuptools setuptools-scm wheel || exit
- python -m pip install --no-cache-dir --user -r bindings/py/packaging/requirements.txt || exit

# we need to find the previous git tags so a shallow clone is not enough
- git fetch --depth=200
Expand Down Expand Up @@ -155,4 +154,4 @@ on_success:
}
2 changes: 1 addition & 1 deletion bindings/py/packaging/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def findRequirements(platform):
Read the requirements.txt file and parse into requirements for setup's
install_requirements option.
"""
requirementsPath = fixPath(os.path.join(PY_BINDINGS, "requirements.txt"))
requirementsPath = fixPath(os.path.join(REPO_DIR, "requirements.txt"))

This comment has been minimized.

Copy link
@dkeeney

dkeeney Sep 24, 2019

What this means is that the requirements.txt file will not be included in the PYPI package.
That would cause pip install to fail (assuming we someday get that to work).

This comment has been minimized.

Copy link
@breznak

breznak Sep 24, 2019

Author Member

I see. Thanks for keeping an eye for this!

  • the change was merely cosmetic (so people don't have to as where our requirements.txt is)
  • I should probably revert the change
  • is there an other option for setup.py to package the requirements file (it does know where it is located)
return [
line.strip()
for line in open(requirementsPath).readlines()
Expand Down
File renamed without changes.

1 comment on commit 46514b2

@dkeeney
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there an other option for setup.py to package the requirements file (it does know where it is located)

As I understand it, the requirement is that setup.py and requirements.txt files (and l bunch of other things) be in the top directory of the wheel package. Setup.py knows to look for them in the same folder. The wheel is constructed from the contents of build\Release\distr. I used a folder inside the build folder so it does not modify our git source tree.

So we have options for how to construct this folder. Right now I copy bindings\py\packaging into that folder and then add the contents of py/src and the extension libraries. I do this both in setup.py and in CMake. We probably don't need it in CMake but at the time I thought there was a reason.

Please sign in to comment.