Skip to content

Add Python build configuration and packaging setup#5

Open
mdellison90-stack with Copilot wants to merge 3 commits into
masterfrom
copilot/initial-setup
Open

Add Python build configuration and packaging setup#5
mdellison90-stack with Copilot wants to merge 3 commits into
masterfrom
copilot/initial-setup

Conversation

Copilot AI commented Jan 25, 2026

Copy link
Copy Markdown

The project lacked standard Python packaging infrastructure, requiring manual dependency installation and preventing pip-based workflows.

Changes

Build Configuration

  • requirements.txt - declares requests dependency
  • setup.py - enables pip install -e . with package metadata
  • requirements-dev.txt - adds pytest, flake8, black, mypy for development
  • MANIFEST.in - excludes database files from distributions

Package Structure

  • app/__init__.py - makes app a discoverable package for setuptools

Docker & Ignores

  • Dockerfile - uses requirements.txt for better layer caching
  • .gitignore - excludes __pycache__, *.egg-info, dist/, build/, virtual environments

Usage

# Install project
pip install -e .

# Install with dev dependencies
pip install -r requirements-dev.txt

# Build Docker image (now caches dependency layer)
docker build -t binance-trader .

Dependencies verified against GitHub Advisory Database - no vulnerabilities found.

Original prompt

Pull Request: mdellison90-stack/bbchop#1


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits January 25, 2026 11:38
Co-authored-by: mdellison90-stack <230609064+mdellison90-stack@users.noreply.github.com>
Co-authored-by: mdellison90-stack <230609064+mdellison90-stack@users.noreply.github.com>
Copilot AI changed the title [WIP] Add initial project setup and configuration Add Python build configuration and packaging setup Jan 25, 2026
@mdellison90-stack
mdellison90-stack marked this pull request as ready for review March 23, 2026 08:50

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bb41a67a0e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread setup.py
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/yasinkuyu/binance-trader",
packages=find_packages(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Fix app imports before exposing it as a setuptools package

Packaging app via find_packages() makes callers import modules as app.*, but the package still uses source-checkout-only imports such as import config and from Database import Database in app/Trading.py. In a clean editable/wheel install, import app.Trading now fails with ModuleNotFoundError unless the user also manually prepends ./app to sys.path, so the new pip install -e . workflow cannot actually load the bot outside the repo root.

Useful? React with 👍 / 👎.

Comment thread setup.py
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/yasinkuyu/binance-trader",
packages=find_packages(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Install the bot entry points with the new package metadata

This setup only publishes the app package. trader.py and balance.py stay outside any package, and there is no scripts= or entry_points= declaration here, so the built wheel/sdist contains no executable to start the bot. After installing from a distribution artifact, users cannot run the workflow described in README.md; python trader.py still works only from a git checkout.

Useful? React with 👍 / 👎.

Comment thread MANIFEST.in
exclude .dockerignore
global-exclude __pycache__
global-exclude *.py[cod]
global-exclude *.db

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Ship the sample database instead of excluding all .db files

app/Database.py opens ../db/orders.db at import time, and README.md still tells users to rename db/orders.sample.db to orders.db. With this global-exclude *.db, the source distribution no longer contains any db/ directory or sample database, so following the packaged install path leaves users with no file to rename and the bot dies with sqlite3.OperationalError: unable to open database file unless they hand-create the database.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants