fix: correct pyproject.toml for project-scaffold-cli
- Fixed package name from auto-readme-cli to project-scaffold-cli - Fixed dependencies to match project-scaffold-cli requirements - Fixed linting import sorting issues in test files
This commit is contained in:
85
project_scaffold_cli/templates/ci/.github/workflows/ci.yml.j2
vendored
Normal file
85
project_scaffold_cli/templates/ci/.github/workflows/ci.yml.j2
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, master]
|
||||
pull_request:
|
||||
branches: [main, master]
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.11'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install flake8 black
|
||||
|
||||
- name: Lint with flake8
|
||||
run: |
|
||||
flake8 .
|
||||
|
||||
- name: Format with black
|
||||
run: |
|
||||
black --check .
|
||||
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
needs: lint
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.11'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -e ".[dev]"
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
pytest -v --cov=.{% raw %}{{ project_slug }}{% endraw %} --cov-report=xml
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
files: ./coverage.xml
|
||||
fail_ci_if_error: false
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
needs: test
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.11'
|
||||
|
||||
- name: Install build
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install build
|
||||
|
||||
- name: Build package
|
||||
run: |
|
||||
python -m build
|
||||
|
||||
- name: Publish to PyPI
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
uses: pypa/gh-action-pypi-publish@release/v1
|
||||
with:
|
||||
password: {% raw %}${{ secrets.PYPI_API_TOKEN }}{% endraw %}
|
||||
43
project_scaffold_cli/templates/ci/.gitlab-ci.yml.j2
Normal file
43
project_scaffold_cli/templates/ci/.gitlab-ci.yml.j2
Normal file
@@ -0,0 +1,43 @@
|
||||
stages:
|
||||
- lint
|
||||
- test
|
||||
- build
|
||||
|
||||
lint:
|
||||
stage: lint
|
||||
image: python:3.11
|
||||
script:
|
||||
- pip install flake8 black
|
||||
- flake8 .
|
||||
- black --check .
|
||||
only:
|
||||
- main
|
||||
- master
|
||||
|
||||
test:
|
||||
stage: test
|
||||
image: python:3.11
|
||||
script:
|
||||
- pip install -e ".[dev]"
|
||||
- pytest -v --cov=.{{ project_slug }} --cov-report=html
|
||||
artifacts:
|
||||
reports:
|
||||
junit: test-results.xml
|
||||
paths:
|
||||
- htmlcov/
|
||||
only:
|
||||
- main
|
||||
- master
|
||||
|
||||
build:
|
||||
stage: build
|
||||
image: python:3.11
|
||||
script:
|
||||
- pip install build
|
||||
- python -m build
|
||||
artifacts:
|
||||
paths:
|
||||
- dist/
|
||||
only:
|
||||
- main
|
||||
- tags
|
||||
27
project_scaffold_cli/templates/go/README.md.j2
Normal file
27
project_scaffold_cli/templates/go/README.md.j2
Normal file
@@ -0,0 +1,27 @@
|
||||
# {{ project_name }}
|
||||
|
||||
{{ description }}
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
go get github.com/{{ author|replace(' ', '-') }}/{{ project_slug }}
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"{{ author|replace(' ', '-') }}/{{ project_slug }}"
|
||||
)
|
||||
|
||||
func main() {
|
||||
{{ project_slug }}.Run()
|
||||
}
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
{{ license }}
|
||||
5
project_scaffold_cli/templates/go/go.mod.j2
Normal file
5
project_scaffold_cli/templates/go/go.mod.j2
Normal file
@@ -0,0 +1,5 @@
|
||||
module {{ project_slug }}
|
||||
|
||||
go 1.20
|
||||
|
||||
require github.com/{{ author|replace(' ', '-') }}/{{ project_slug }} v1.0.0
|
||||
9
project_scaffold_cli/templates/go/main.go.j2
Normal file
9
project_scaffold_cli/templates/go/main.go.j2
Normal file
@@ -0,0 +1,9 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func main() {
|
||||
fmt.Println("Welcome to {{ project_name }}!")
|
||||
}
|
||||
21
project_scaffold_cli/templates/nodejs/README.md.j2
Normal file
21
project_scaffold_cli/templates/nodejs/README.md.j2
Normal file
@@ -0,0 +1,21 @@
|
||||
# {{ project_name }}
|
||||
|
||||
{{ description }}
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```javascript
|
||||
const {{ project_slug }} = require('./index.js');
|
||||
|
||||
{{ project_slug }}();
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
{{ license }}
|
||||
12
project_scaffold_cli/templates/nodejs/index.js.j2
Normal file
12
project_scaffold_cli/templates/nodejs/index.js.j2
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/**
|
||||
* {{ project_name }}
|
||||
* {{ description }}
|
||||
*/
|
||||
|
||||
function main() {
|
||||
console.log('Welcome to {{ project_name }}!');
|
||||
}
|
||||
|
||||
main();
|
||||
1
project_scaffold_cli/templates/python/README.md.j2
Normal file
1
project_scaffold_cli/templates/python/README.md.j2
Normal file
@@ -0,0 +1 @@
|
||||
{{ description }}
|
||||
48
project_scaffold_cli/templates/python/setup.py.j2
Normal file
48
project_scaffold_cli/templates/python/setup.py.j2
Normal file
@@ -0,0 +1,48 @@
|
||||
from setuptools import setup, find_packages
|
||||
|
||||
with open("README.md", "r", encoding="utf-8") as fh:
|
||||
long_description = fh.read()
|
||||
|
||||
setup(
|
||||
name="{{ project_slug }}",
|
||||
version="1.0.0",
|
||||
author="{{ author }}",
|
||||
author_email="{{ email }}",
|
||||
description="{{ description }}",
|
||||
long_description=long_description,
|
||||
long_description_content_type="text/markdown",
|
||||
url="https://github.com/{{ author|replace(' ', '-') }}/{{ project_slug }}",
|
||||
packages=find_packages(),
|
||||
python_requires=">=3.8",
|
||||
install_requires=[
|
||||
{% if template_vars and template_vars.python %}
|
||||
{% for dep in template_vars.python.get('dependencies', []) %}
|
||||
"{{ dep }}",
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
{% endif %}
|
||||
],
|
||||
extras_require={
|
||||
"dev": [
|
||||
"pytest>=7.0",
|
||||
"pytest-cov>=4.0",
|
||||
"black>=23.0",
|
||||
"flake8>=6.0",
|
||||
],
|
||||
},
|
||||
entry_points={
|
||||
"console_scripts": [
|
||||
"{{ project_slug }}={{ project_slug }}.cli:main",
|
||||
],
|
||||
},
|
||||
classifiers=[
|
||||
"Development Status :: 3 - Alpha",
|
||||
"Intended Audience :: Developers",
|
||||
"License :: OSI Approved :: MIT License",
|
||||
"Programming Language :: Python :: 3",
|
||||
"Programming Language :: Python :: 3.8",
|
||||
"Programming Language :: Python :: 3.9",
|
||||
"Programming Language :: Python :: 3.10",
|
||||
"Programming Language :: Python :: 3.11",
|
||||
],
|
||||
)
|
||||
@@ -0,0 +1 @@
|
||||
{{ project_slug }}
|
||||
@@ -0,0 +1,13 @@
|
||||
"""Main CLI entry point."""
|
||||
|
||||
import click
|
||||
|
||||
|
||||
@click.command()
|
||||
def main():
|
||||
"""Main entry point for {{ project_name }}."""
|
||||
click.echo("Welcome to {{ project_name }}!")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,15 @@
|
||||
"""Test module for {{ project_name }}."""
|
||||
|
||||
import pytest
|
||||
|
||||
from {{ project_slug }} import __version__
|
||||
|
||||
|
||||
def test_version():
|
||||
"""Test version is a string."""
|
||||
assert isinstance(__version__, str)
|
||||
|
||||
|
||||
def test_example():
|
||||
"""Example test."""
|
||||
assert True
|
||||
9
project_scaffold_cli/templates/rust/Cargo.toml.j2
Normal file
9
project_scaffold_cli/templates/rust/Cargo.toml.j2
Normal file
@@ -0,0 +1,9 @@
|
||||
[package]
|
||||
name = "{{ project_slug }}"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
authors = ["{{ author }} <{{ email }}>"]
|
||||
description = "{{ description }}"
|
||||
license = "{{ license }}"
|
||||
|
||||
[dependencies]
|
||||
23
project_scaffold_cli/templates/rust/README.md.j2
Normal file
23
project_scaffold_cli/templates/rust/README.md.j2
Normal file
@@ -0,0 +1,23 @@
|
||||
# {{ project_name }}
|
||||
|
||||
{{ description }}
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
cargo add {{ project_slug }}
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```rust
|
||||
use {{ project_slug }}::run;
|
||||
|
||||
fn main() {
|
||||
run();
|
||||
}
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
{{ license }}
|
||||
3
project_scaffold_cli/templates/rust/src/main.rs.j2
Normal file
3
project_scaffold_cli/templates/rust/src/main.rs.j2
Normal file
@@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
println!("Welcome to {{ project_name }}!");
|
||||
}
|
||||
Reference in New Issue
Block a user