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
17 changes: 17 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[run]
source = purl2src
omit =
*/tests/*
*/test_*.py
*/__pycache__/*
*/site-packages/*

[report]
exclude_lines =
pragma: no cover
def __repr__
raise AssertionError
raise NotImplementedError
if __name__ == .__main__.:
if TYPE_CHECKING:
@abstractmethod
55 changes: 55 additions & 0 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: PR Validation

permissions:
contents: read
pull-requests: write

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
test-and-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest ruff black
pip install -e . || pip install .

- name: Format check with black
run: |
black --check . || echo "Formatting issues found (non-blocking)"

- name: Lint with ruff
run: |
ruff check . || echo "Linting issues found (non-blocking)"

- name: Run tests
run: |
pytest tests/ -v --tb=short

documentation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Check required files
run: |
required_files="README.md LICENSE AUTHORS.md CONTRIBUTING.md pyproject.toml"
for file in $required_files; do
if [ -f "$file" ]; then
echo "✓ $file exists"
else
echo "✗ $file is missing"
exit 1
fi
done
72 changes: 14 additions & 58 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,90 +1,46 @@
name: Release

permissions:
contents: write
id-token: write

on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
version:
description: 'Version to release (e.g., 1.2.3)'
required: true

permissions:
contents: write

jobs:
test:
uses: ./.github/workflows/test.yml

build:
needs: test
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.13'

- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build twine

- name: Build package
run: |
python -m build
run: python -m build

- name: Check package
run: |
twine check dist/*

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
run: twine check dist/*

release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4

- name: Download artifacts
uses: actions/download-artifact@v4
- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags/')
uses: pypa/gh-action-pypi-publish@release/v1
with:
name: dist
path: dist/
skip-existing: true

- name: Create Release
- name: Create GitHub Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: dist/*
generate_release_notes: true
draft: false
prerelease: false

publish-pypi:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
environment:
name: pypi
url: https://pypi.org/project/purl2src/
permissions:
id-token: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist/

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
110 changes: 17 additions & 93 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,121 +1,45 @@
name: Test
name: Tests

permissions:
contents: read

on:
push:
branches: [ main ]
branches: [ main, develop ]
pull_request:
branches: [ main ]
workflow_dispatch:
workflow_call:

jobs:
test:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.13"]

steps:
- uses: actions/checkout@v4

- name: Set up Python
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev]

- name: Lint with flake8
run: |
flake8 src/ tests/ --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 src/ tests/ --count --exit-zero --max-complexity=10 --max-line-length=100 --statistics

- name: Format check with black
run: |
black --check src/ tests/

- name: Type check with mypy
run: |
mypy src/
pip install pytest pytest-cov
pip install -e . || pip install .

- name: Test with pytest
- name: Run tests
run: |
pytest -v --cov=purl2src --cov-report=term-missing --cov-report=xml
pytest tests/ -v --tb=short

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
- name: Upload coverage
if: matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false

test-package-managers:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '7.0.x'

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.21'

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable

- name: Install package managers
run: |
# Maven is pre-installed on GitHub runners
mvn --version
# NPM comes with Node.js
npm --version
# Gem comes with Ruby
gem --version
# NuGet comes with .NET
dotnet nuget --version
# Go is installed
go version
# Cargo comes with Rust
cargo --version
# Install pip packages
pip --version
# Install Conda
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
bash miniconda.sh -b -p $HOME/miniconda
export PATH="$HOME/miniconda/bin:$PATH"
conda --version

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev]

- name: Run integration tests
run: |
export PATH="$HOME/miniconda/bin:$PATH"
pytest tests/ -v -m "not slow" --cov=purl2src --cov-report=term-missing
9 changes: 9 additions & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Authors

## Project Lead

* Oscar Valenzuela B. - Project creator and lead developer

---

For a complete list of all contributors, please see the [GitHub contributors page](https://github.com/SemClone/purl2src/graphs/contributors).
59 changes: 59 additions & 0 deletions SUPPORT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Support

## How to Get Help

Thank you for using this project! Here are the best ways to get help:

### Documentation

- Check the [README](README.md) for basic usage and setup instructions
- Review the [CONTRIBUTING](CONTRIBUTING.md) guide for development setup
- Look through existing documentation in the `/docs` folder (if available)

### Getting Answers

**Before opening an issue:**
1. Search existing [GitHub Issues](../../issues) to see if your question has been answered
2. Check closed issues as well - your question might have been resolved
3. Review the project's documentation thoroughly

### Reporting Issues

If you've found a bug or have a feature request:

1. **Search first**: Check if someone else has already reported the same issue
2. **Create a detailed report**: Use our issue templates when available
3. **Include context**: Provide OS, Python version, and relevant configuration
4. **Share reproducible steps**: Help us understand how to reproduce the issue

### Feature Requests

We welcome feature suggestions! Please:
- Check existing issues for similar requests
- Clearly describe the feature and its use case
- Explain why this feature would be valuable to the project

### Security Issues

For security vulnerabilities, please refer to our [SECURITY](SECURITY.md) policy for responsible disclosure guidelines.

## Community Guidelines

Please review our [Code of Conduct](CODE_OF_CONDUCT.md) before participating in discussions.

## Response Times

This project is maintained by a small team. While we strive to respond quickly:
- Issues: Initial response within 7 days
- Pull requests: Review within 14 days
- Security issues: Within 48 hours

## Additional Resources

- **Project Homepage**: [GitHub Repository](../../)
- **License**: See [LICENSE](LICENSE) file
- **Contributing**: See [CONTRIBUTING](CONTRIBUTING.md) guide

---

**Note**: This is an open-source project maintained by volunteers. Response times may vary based on contributor availability.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ license = {text = "Apache-2.0"}
authors = [
{name = "Oscar Valenzuela B.", email = "oscar.valenzuela.b@gmail.com"},
]
keywords = ["purl", "package-url", "package-manager", "source-code", "license-compliance", "ai-detection", "semantic-analysis", "semantic-copycat", "code-copycat"]
keywords = ["purl", "package-url", "package-manager", "source-code", "license-compliance", "ai-detection", "semantic-analysis"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
Expand Down
Loading