This document provides information about the current setup and how to work with the GraphQLNomad project.
GraphQLNomad is a dual-distribution package:
- Python Package: Primary distribution via PyPI
- NPM Wrapper: Node.js wrapper for npm installation (requires Python/pipx)
- Python 3.6 or higher (tested with 3.10 and 3.12)
- pip (Python package manager)
- Node.js (tested with v20.x)
- npm (tested with v10.x)
- Clone the repository:
git clone https://github.com/CYBWithFlourish/GraphQLNomad.git
cd GraphQLNomad- Install in editable mode:
pip install -e .- Verify installation:
graphqlnomad --version
python -m graphqlnomad --helppipx install graphqlnomadnpm install -g graphqlnomadgraphqlnomad/: Main package directory__init__.py: Package initialization (empty)__main__.py: Module entry pointnomad.py: Main implementation (GraphQLNomad class and CLI logic)
setup.py: Python package configurationrequirements.txt: Python dependencies (requests, colorama)
package.json: NPM package configurationrun.js: Node.js wrapper script that spawns the Python CLI
.gitignore: Git ignore patterns.npmignore: NPM publish ignore patterns.github/workflows/ci-workflow.yml: GitHub Actions CI/CD pipeline
The project uses flake8 for Python code linting:
# Install flake8
pip install flake8
# Run critical error checks (must pass)
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# Run full linting (warnings only)
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statisticsCurrent Status: All critical errors are fixed. Some non-critical style warnings remain (69 warnings as of latest update).
Basic tests are run via the CI pipeline:
# Test module execution
python -m graphqlnomad --help
# Test CLI entry point
graphqlnomad --versionThe project uses GitHub Actions for continuous integration:
- Trigger: Push or PR to main branch
- Python Version: 3.10
- Steps:
- Checkout repository
- Setup Python
- Install dependencies (pip, flake8, package)
- Lint with flake8
- Run basic module test
- Test CLI entry point
See .github/workflows/ci-workflow.yml for details.
Error: npm error config prefix cannot be changed from project config
Solution: This was caused by a user-specific .npmrc file in the repository. It has been removed and added to .gitignore. If you need local npm configuration, create .npmrc in your home directory instead.
Solution: Reinstall the package in editable mode:
pip install -e .Note: The CI uses --exit-zero for the full flake8 check, so warnings don't fail the build. Critical errors (E9, F63, F7, F82) must be fixed.
- Before making changes: Run linting to understand baseline
- Make minimal changes: Focus on the specific issue
- Test locally: Run the package and verify functionality
- Run linting: Ensure no new critical errors are introduced
- Commit and push: The CI will automatically run tests
requests: HTTP client for GraphQL requestscolorama: Terminal color output
flake8: Code linting and style checking
The package uses setup.py with setuptools. Version is currently 1.0.0.
The npm package is a lightweight wrapper that depends on the Python package being available via pipx. The postinstall script automatically installs the Python package.
-
.npmrcshould NOT be committed: User-specific npm configuration belongs in the user's home directory, not the repository. -
The npm package requires Python: The npm distribution is a convenience wrapper - it requires Python and pipx to be installed.
-
Version synchronization: Keep version numbers in sync across:
setup.pypackage.jsongraphqlnomad/nomad.py(in BANNER and argument parser)
-
Code style: The codebase uses compact Python style with some single-line conditionals. While this generates flake8 warnings, it's acceptable as long as critical errors are avoided.
For issues and feature requests, visit: https://github.com/CYBWithFlourish/GraphQLNomad/issues
See README.md for contribution guidelines.