Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing tarball #560

Merged
merged 10 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 19 additions & 14 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,25 @@ name: Build
on: [pull_request]

jobs:
make_sdist:
name: Make SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build SDist
run: pipx run build --sdist

# - name: Test if SDist build has all necessary pieces to be installed
# run: |
# pip3 install setuptools build --upgrade
# pip3 install dist/*.tar.gz

- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz

build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
Expand All @@ -27,20 +46,6 @@ jobs:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl

make_sdist:
name: Make SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build SDist
run: pipx run build --sdist

- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz

upload_all:
needs: [build_wheels, make_sdist]
environment: pypi
Expand Down
28 changes: 0 additions & 28 deletions .github/workflows/debug_tests.yml

This file was deleted.

5 changes: 0 additions & 5 deletions __version__.py

This file was deleted.

23 changes: 17 additions & 6 deletions aequilibrae/utils/python_signal.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import importlib.util as iutil
import os
import warnings
from random import choice

Expand All @@ -13,8 +14,7 @@

qgis = iutil.find_spec("qgis") is not None

if missing_tqdm and not qgis:
warnings.warn("No progress bars will be shown. Please install tqdm to see them")
show_status = os.environ.get("AEQ_SHOW_PROGRESS", "FALSE") == "TRUE"


class PythonSignal: # type: ignore
Expand All @@ -28,23 +28,26 @@ class PythonSignal: # type: ignore
['action', 'bar hierarchy', 'value', 'text', 'master']

'action': 'start', 'update', or 'finished_*_processing' (the last one applies in QGIS)
'bar hierarchy': 'master' or 'secondary'
'position': Position (0 for top, 1 for bottom)
'value': Numerical value for the action (total or current)
'text': Whatever label to be updated
'master': The corresponding master bar for this task
"""

deactivate = missing_tqdm # by default don't use progress bars in tests
deactivate = not show_status # by default don't use progress bars in tests
jamiecook marked this conversation as resolved.
Show resolved Hide resolved

def __init__(self, object):
self.color = choice(["green", "magenta", "cyan", "blue", "red", "yellow"])
self.pbar = None # type: tqdm
self.keydata = {}
self.pos = 0
self.position = 0

def emit(self, val):
if self.deactivate:
return
if val[0] == "set_position":
self.position = val[1]

if val[0] == "finished":
if self.pbar is not None:
self.pbar.close()
Expand All @@ -61,14 +64,22 @@ def emit(self, val):
self.keydata[val[1]] = val[2]

elif val[0] == "start":
if missing_tqdm and not qgis:
self.deactivate = True
warnings.warn("No progress bars will be shown. Please install tqdm to see them")
if self.pbar is not None:
self.pbar.close()
desc = str(val[2]).rjust(50)
self.pbar = tqdm(total=val[1], colour=self.color, leave=False, desc=desc, position=self.pos)
self.pbar = tqdm(total=val[1], colour=self.color, leave=False, desc=desc, position=self.position)

elif val[0] == "update":
self.pbar.update(val[1] - self.pbar.n)
if len(val) > 2:
desc = str(val[2]).rjust(50)
if self.pbar.desc != desc:
self.pbar.set_description(desc, refresh=True)

elif val[0] == "set_text":
desc = str(val[1]).rjust(50)
if self.pbar.desc != desc:
self.pbar.set_description(desc, refresh=True)
2 changes: 1 addition & 1 deletion aequilibrae/utils/signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def noop(_):
pass


if iutil.find_spec("PyQt5") is not None:
if iutil.find_spec("qgis") is not None:
jamiecook marked this conversation as resolved.
Show resolved Hide resolved
from PyQt5.QtCore import pyqtSignal as SIGNAL # type: ignore

noop(SIGNAL.__class__) # This should be no-op but it stops PyCharm from "optimising" the above import
Expand Down
4 changes: 0 additions & 4 deletions docs/requirements-docs.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
numpy<1.99
pyaml
pyshp
cython
enum34
Sphinx
pydata-sphinx-theme==0.13.3
Expand Down
10 changes: 5 additions & 5 deletions docs/source/_static/switcher.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
"version": "develop",
"url": "https://aequilibrae.com/python/develop/"
},
{
"name": "1.1.1",
"version": "1.1.1",
"url": "https://aequilibrae.com/python/V.1.1.1/"
},
{
"name": "1.1.0",
"version": "1.1.0",
"url": "https://aequilibrae.com/python/V.1.1.0/"
},
{
jamiecook marked this conversation as resolved.
Show resolved Hide resolved
"name": "1.0.2",
"version": "1.0.2",
"url": "https://aequilibrae.com/python/V.1.0.2/"
},
{
"name": "1.0.1",
"version": "1.0.1",
Expand Down
3 changes: 2 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from datetime import datetime
from pathlib import Path
from sphinx_gallery.sorting import ExplicitOrder
import pkg_resources
jamiecook marked this conversation as resolved.
Show resolved Hide resolved

project_dir = Path(__file__).parent.parent.parent
if str(project_dir) not in sys.path:
Expand All @@ -27,7 +28,7 @@
if str(project_dir) not in sys.path:
sys.path.insert(0, project_dir)

from __version__ import release_version
release_version = pkg_resources.get_distribution("aequilibrae").version

# -- Project information -----------------------------------------------------

Expand Down
4 changes: 2 additions & 2 deletions docs/website/check_documentation_versions.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import os
import sys
from pathlib import Path
import pkg_resources

npth = Path(__file__).parent.parent.parent
if npth not in sys.path:
sys.path.append(npth)
print(npth)

with open(npth / "__version__.py") as f:
exec(f.read())
release_version = pkg_resources.get_distribution("aequilibrae").version

# We check if the reference to all existing versions were added by checking
# that the current version is referenced
Expand Down
4 changes: 2 additions & 2 deletions docs/website/redir.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import os
import sys
import shutil
import pkg_resources

npth = os.path.abspath(".")
if npth not in sys.path:
sys.path.append(npth)

from __version__ import release_version

release_version = pkg_resources.get_distribution("aequilibrae").version

version = f"V.{release_version}"

Expand Down
16 changes: 10 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@
from setuptools import setup, find_packages
from setuptools.discovery import FlatLayoutPackageFinder

with open("__version__.py") as f:
exec(f.read())
# When updating the version, one must also update the docs/source/_static/switcher.json file
version = 1.1
minor_version = 1

release_version = f"{version}.{minor_version}"

include_dirs = [np.get_include()]
libraries = []
Expand Down Expand Up @@ -45,7 +48,7 @@

ext_mod_ipf = Extension(
"aequilibrae.distribution.ipf_core",
[join("aequilibrae", "distribution", "ipf_core.pyx")],
[join("aequilibrae", "distribution", "cython", "ipf_core.pyx")],
**extension_args,
)

Expand Down Expand Up @@ -98,9 +101,10 @@

pkg_data = {
"aequilibrae.reference_files": ["spatialite.sqlite", "nauru.zip", "sioux_falls.zip", "coquimbo.zip"],
"aequilibrae.paths": ["parameters.pxi", "*.pyx"],
"aequilibrae.distribution": ["*.pyx"],
"aequilibrae": ["./parameters.yml"],
"aequilibrae.paths": ["cython/*.pxi", "cython/*.pyx", "cython/*.pxd"],
"aequilibrae.distribution": ["cython/*.pyx"],
"aequilibrae.matrix": ["*.pyx", "*.pxd"],
"aequilibrae": ["./parameters.yml", "../requirements.txt"],
"aequilibrae.project": [
"database_specification/network/tables/*.*",
"database_specification/network/triggers/*.*",
Expand Down