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

Build project with build & pyproject.toml #1855

Merged
merged 1 commit into from
Feb 7, 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
6 changes: 4 additions & 2 deletions .github/workflows/backend-production-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ jobs:
run: heroku plugins:install heroku-builds

- name: Build app into tarball
run: python setup.py sdist --formats=gztar
run: |
pip install build
python -m build --sdist

- name: Create Heroku Build
run: heroku builds:create -a dandi-api --source-tar=dist/$(python setup.py --fullname).tar.gz
run: heroku builds:create -a dandi-api --source-tar dist/*.tar.gz
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
HEROKU_EMAIL: ${{ secrets.HEROKU_EMAIL }}
6 changes: 4 additions & 2 deletions .github/workflows/backend-staging-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ jobs:
run: heroku plugins:install heroku-builds

- name: Build app into tarball
run: python setup.py sdist --formats=gztar
run: |
pip install build
python -m build --sdist

- name: Create Heroku Build
run: heroku builds:create -a dandi-api-staging --source-tar=dist/$(python setup.py --fullname).tar.gz
run: heroku builds:create -a dandi-api-staging --source-tar dist/*.tar.gz
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
HEROKU_EMAIL: ${{ secrets.HEROKU_EMAIL }}
3 changes: 2 additions & 1 deletion dev/django.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ RUN apt-get update && \
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

# Only copy the setup.py and setup.cfg, it will still force all install_requires to be installed,
# Only copy the pyproject.toml, setup.py, and setup.cfg. It will still force all install_requires to be installed,
# but find_packages() will find nothing (which is fine). When Docker Compose mounts the real source
# over top of this directory, the .egg-link in site-packages resolves to the mounted directory
# and all package modules are importable.
COPY ./pyproject.toml /opt/django-project/pyproject.toml
COPY ./setup.cfg /opt/django-project/setup.cfg
COPY ./setup.py /opt/django-project/setup.py

Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"

[tool.mypy]
ignore_missing_imports = true
show_error_codes = true
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
description='',
# Determine version with scm
use_scm_version={'version_scheme': 'post-release'},
setup_requires=['setuptools_scm'],
long_description=long_description,
long_description_content_type='text/markdown',
license='Apache 2.0',
Expand Down