Skip to content

Commit

Permalink
Set nightly build project.name in pyproject.toml
Browse files Browse the repository at this point in the history
Closes #1379
It seems that python -m build . ignores the project name from the
setuptools.setup function when running setup.py. This commit moves
the dynamic project name from setup.py to the nightly.yml workflow,
using the dasel command-line tool to modify project.name in
pyproject.toml.

I also add a workflow_dispatch trigger to nightly.yml for testing.
  • Loading branch information
maresb authored and brandonwillard committed Dec 31, 2022
1 parent baa6b7f commit 0b6b8df
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Nightly
name: Development builds
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"

Expand All @@ -15,10 +16,16 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install dependencies
- name: Install dependencies and customize pyproject.toml
run: |
python -m pip install -U pip
python -m pip install build
# Download dasel to modify pyproject.toml
curl -sSLf https://github.com/TomWright/dasel/releases/download/v2.0.2/dasel_linux_amd64 \
-L -o /tmp/dasel && chmod +x /tmp/dasel
/tmp/dasel put -f pyproject.toml project.name -v aesara-nightly
# Install build prerequisites
python -m pip install -U pip build
- name: Build the sdist
run: python -m build --sdist .
env:
Expand Down
6 changes: 0 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,8 @@
dist = Distribution()
dist.parse_config_files()


NAME: str = dist.get_name() # type: ignore

# Handle builds of nightly release
if "BUILD_AESARA_NIGHTLY" in os.environ:
NAME += "-nightly"

from versioneer import get_versions as original_get_versions

def get_versions():
Expand All @@ -32,7 +27,6 @@ def get_versions():

if __name__ == "__main__":
setup(
name=NAME,
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
)

0 comments on commit 0b6b8df

Please sign in to comment.