Skip to content
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
44 changes: 44 additions & 0 deletions .github/workflows/py-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Python Client CI

on:
push:
branches: [ main ]
paths:
- 'source/py-cli/**'
pull_request:
branches: [ main ]
paths:
- 'source/py-cli/**'

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./source/py-cli

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'pip'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest requests-mock
pip install .

- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings.
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

- name: Test with pytest
run: |
pytest
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Release

on:
push:
tags:
- 'v*'

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Build and Publish TS
working-directory: ./source/ts-cli
run: |
npm ci
npm run build
# npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Build and Publish Python
working-directory: ./source/py-cli
run: |
pip install build twine
python -m build
# twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
40 changes: 40 additions & 0 deletions .github/workflows/ts-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: TS Client CI

on:
push:
branches: [ main ]
paths:
- 'source/ts-cli/**'
pull_request:
branches: [ main ]
paths:
- 'source/ts-cli/**'

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./source/ts-cli

steps:
- uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'
cache: 'npm'
cache-dependency-path: source/ts-cli/package-lock.json

- name: Install dependencies
run: npm ci

- name: Lint
run: npm run lint --if-present

- name: Build
run: npm run build

- name: Test
run: npm test
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
node_modules/
dist/
coverage/
.DS_Store
*.log
.env
__pycache__/
*.pyc
.pytest_cache/
venv/
.idea/
.vscode/
x-cli.egg-info/
build/
23 changes: 23 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

## Enforcement

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 1.4.
43 changes: 43 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Contributing to x-cli

We welcome contributions! Please read this document before getting started.

## Development Setup

### Prerequisites

- Node.js 18+
- Python 3.9+
- Git

### TypeScript Client

1. Navigate to `source/ts-cli`.
2. Install dependencies: `npm install`.
3. Run build: `npm run build`.
4. Run tests: `npm test`.
5. Run dev mode: `npm run dev` (if available) or `npm start`.

### Python Client

1. Navigate to `source/py-cli`.
2. Create a virtual env: `python -m venv venv && source venv/bin/activate`.
3. Install editable: `pip install -e .[dev]`.
4. Run tests: `pytest`.

## Code Style

- **TS:** We use `xo` / `eslint` and `prettier`. Run `npm run lint`.
- **Python:** We use `black` and `flake8`.

## Pull Request Process

1. Fork the repository.
2. Create a feature branch.
3. Add tests for your changes.
4. Ensure all tests pass.
5. Submit a PR with a clear description.

## Commit Messages

Please follow the Conventional Commits specification (e.g., `feat: add search`, `fix: handle 429`).
Loading
Loading