forked from inventree/InvenTree
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This reverts commit a50f6af.
- Loading branch information
Showing
1,465 changed files
with
299,558 additions
and
437,636 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: | ||
// https://github.com/microsoft/vscode-dev-containers/tree/v0.241.1/containers/python-3 | ||
{ | ||
"name": "InvenTree devcontainer", | ||
"dockerComposeFile": "docker-compose.yml", | ||
"service": "inventree", | ||
"overrideCommand": true, | ||
"workspaceFolder": "/home/inventree/", | ||
|
||
// Configure tool-specific properties. | ||
"customizations": { | ||
// Configure properties specific to VS Code. | ||
"vscode": { | ||
// Set *default* container specific settings.json values on container create. | ||
"settings": { | ||
"python.defaultInterpreterPath": "${containerWorkspaceFolder}/dev/venv/bin/python", | ||
"python.linting.enabled": true, | ||
"python.linting.pylintEnabled": false, | ||
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8", | ||
"python.formatting.blackPath": "/usr/local/py-utils/bin/black", | ||
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf", | ||
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit", | ||
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy", | ||
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle", | ||
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle", | ||
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint" | ||
}, | ||
|
||
// Add the IDs of extensions you want installed when the container is created. | ||
"extensions": [ | ||
"ms-python.python", | ||
"ms-python.vscode-pylance", | ||
"batisteo.vscode-django", | ||
"eamodio.gitlens" | ||
] | ||
} | ||
}, | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
"forwardPorts": [5173, 8000, 8080], | ||
"portsAttributes": { | ||
"5173": { | ||
"label": "Vite Server" | ||
}, | ||
"8000": { | ||
"label": "InvenTree Server" | ||
}, | ||
"8080": { | ||
"label": "mkdocs server" | ||
} | ||
}, | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
"postCreateCommand": ".devcontainer/postCreateCommand.sh", | ||
|
||
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. | ||
"remoteUser": "vscode", | ||
"containerUser": "vscode", | ||
|
||
"remoteEnv": { | ||
|
||
// Python config | ||
"PIP_USER": "no", | ||
|
||
// used to load the venv into the PATH and activate it | ||
// Ref: https://stackoverflow.com/a/56286534 | ||
"VIRTUAL_ENV": "${containerWorkspaceFolder}/dev/venv", | ||
"PATH": "${containerWorkspaceFolder}/dev/venv/bin:${containerEnv:PATH}" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
version: "3" | ||
|
||
services: | ||
db: | ||
image: postgres:13 | ||
restart: unless-stopped | ||
expose: | ||
- 5432/tcp | ||
volumes: | ||
- inventreedatabase:/var/lib/postgresql/data:z | ||
environment: | ||
POSTGRES_DB: inventree | ||
POSTGRES_USER: inventree_user | ||
POSTGRES_PASSWORD: inventree_password | ||
|
||
inventree: | ||
build: | ||
context: .. | ||
dockerfile: ../InvenTree/contrib/container/Dockerfile | ||
target: dev | ||
args: | ||
base_image: "mcr.microsoft.com/vscode/devcontainers/base:alpine-3.18" | ||
data_dir: "dev" | ||
volumes: | ||
- ../:/home/inventree:z | ||
|
||
environment: | ||
INVENTREE_DEBUG: True | ||
INVENTREE_DB_ENGINE: postgresql | ||
INVENTREE_DB_NAME: inventree | ||
INVENTREE_DB_HOST: db | ||
INVENTREE_DB_USER: inventree_user | ||
INVENTREE_DB_PASSWORD: inventree_password | ||
INVENTREE_PLUGINS_ENABLED: True | ||
INVENTREE_SITE_URL: http://localhost:8000 | ||
INVENTREE_CORS_ORIGIN_ALLOW_ALL: True | ||
INVENTREE_PY_ENV: /home/inventree/dev/venv | ||
|
||
depends_on: | ||
- db | ||
|
||
volumes: | ||
inventreedatabase: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
# Avoiding Dubious Ownership in Dev Containers for setup commands that use git | ||
git config --global --add safe.directory /home/inventree | ||
|
||
# create venv | ||
python3 -m venv /home/inventree/dev/venv --system-site-packages --upgrade-deps | ||
. /home/inventree/dev/venv/bin/activate | ||
|
||
# Run initial InvenTree server setup | ||
invoke update -s | ||
|
||
# Configure dev environment | ||
invoke setup-dev | ||
|
||
# Install required frontend packages | ||
invoke frontend-install | ||
|
||
# remove existing gitconfig created by "Avoiding Dubious Ownership" step | ||
# so that it gets copied from host to the container to have your global | ||
# git config in container | ||
rm -f /home/vscode/.gitconfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# Python Django | ||
# Test a Django project on multiple versions of Python. | ||
# Add steps that analyze code, save build artifacts, deploy, and more: | ||
# https://docs.microsoft.com/azure/devops/pipelines/languages/python | ||
|
||
trigger: | ||
- master | ||
|
||
pool: | ||
vmImage: ubuntu-latest | ||
strategy: | ||
matrix: | ||
Python39: | ||
PYTHON_VERSION: '3.9' | ||
maxParallel: 3 | ||
|
||
steps: | ||
- task: UsePythonVersion@0 | ||
inputs: | ||
versionSpec: '$(PYTHON_VERSION)' | ||
architecture: 'x64' | ||
|
||
- task: PythonScript@0 | ||
displayName: 'Export project path' | ||
inputs: | ||
scriptSource: 'inline' | ||
script: | | ||
"""Search all subdirectories for `manage.py`.""" | ||
from glob import iglob | ||
from os import path | ||
# Python >= 3.5 | ||
manage_py = next(iglob(path.join('**', 'manage.py'), recursive=True), None) | ||
if not manage_py: | ||
raise SystemExit('Could not find a Django project') | ||
project_location = path.dirname(path.abspath(manage_py)) | ||
print('Found Django project in', project_location) | ||
print('##vso[task.setvariable variable=projectRoot]{}'.format(project_location)) | ||
- script: | | ||
python -m pip install --upgrade pip setuptools wheel | ||
pip install --require-hashes -r requirements.txt | ||
pip install --require-hashes -r requirements-dev.txt | ||
pip install unittest-xml-reporting coverage invoke | ||
sudo apt-get install poppler-utils | ||
sudo apt-get install libpoppler-dev | ||
displayName: 'Install prerequisites' | ||
|
||
- script: | | ||
pushd '$(projectRoot)' | ||
invoke update | ||
coverage run manage.py test --testrunner xmlrunner.extra.djangotestrunner.XMLTestRunner --no-input | ||
coverage xml -i | ||
displayName: 'Run tests' | ||
env: | ||
INVENTREE_DB_ENGINE: sqlite3 | ||
INVENTREE_DB_NAME: inventree | ||
INVENTREE_MEDIA_ROOT: ./media | ||
INVENTREE_STATIC_ROOT: ./static | ||
INVENTREE_BACKUP_DIR: ./backup | ||
INVENTREE_PLUGINS_ENABLED: true | ||
|
||
- task: PublishTestResults@2 | ||
inputs: | ||
testResultsFiles: "**/TEST-*.xml" | ||
testRunTitle: 'Python $(PYTHON_VERSION)' | ||
condition: succeededOrFailed() | ||
|
||
- task: PublishCodeCoverageResults@1 | ||
inputs: | ||
codeCoverageTool: Cobertura | ||
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml' |
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,13 @@ | ||
* @matmair | ||
# General owner is the maintainers team | ||
* @SchrodingersGat | ||
|
||
# plugins are co-owned | ||
/src/backend/InvenTree/plugin/ @SchrodingersGat @matmair | ||
/src/backend/InvenTree/plugins/ @SchrodingersGat @matmair | ||
|
||
# Installer functions | ||
.pkgr.yml @matmair | ||
Procfile @matmair | ||
runtime.txt @matmair | ||
/contrib/installer @matmair | ||
/contrib/packager.io @matmair |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
github: inventree | ||
ko_fi: inventree | ||
patreon: inventree | ||
polar: inventree | ||
custom: [paypal.me/inventree] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: "Bug" | ||
description: "Create a bug report to help us improve InvenTree!" | ||
labels: ["bug", "question", "triage:not-checked"] | ||
body: | ||
- type: checkboxes | ||
id: no-duplicate-issues | ||
attributes: | ||
label: "Please verify that this bug has NOT been raised before." | ||
description: "Search in the issues sections by clicking [HERE](https://github.com/inventree/inventree/issues?q=) and read the [Frequently Asked Questions](https://docs.inventree.org/en/latest/faq/)!" | ||
options: | ||
- label: "I checked and didn't find a similar issue" | ||
required: true | ||
- type: textarea | ||
id: description | ||
validations: | ||
required: true | ||
attributes: | ||
label: "Describe the bug*" | ||
description: "A clear and concise description of what the bug is." | ||
- type: textarea | ||
id: steps-to-reproduce | ||
validations: | ||
required: true | ||
attributes: | ||
label: "Steps to Reproduce" | ||
description: "Steps to reproduce the behaviour, please make it detailed" | ||
placeholder: | | ||
1. Go to '...' | ||
2. Click on '....' | ||
3. Scroll down to '....' | ||
4. See the error | ||
- type: textarea | ||
id: expected-behavior | ||
validations: | ||
required: true | ||
attributes: | ||
label: "Expected behaviour" | ||
description: "A clear and concise description of what you expected to happen." | ||
placeholder: "..." | ||
- type: checkboxes | ||
id: deployment | ||
attributes: | ||
label: "Deployment Method" | ||
options: | ||
- label: "Docker" | ||
- label: "Package" | ||
- label: "Bare metal" | ||
- label: "Other - added info in Steps to Reproduce" | ||
- type: textarea | ||
id: version-info | ||
validations: | ||
required: true | ||
attributes: | ||
label: "Version Information" | ||
description: "The version info block." | ||
placeholder: "You can get this by going to the `About InvenTree` section in the upper right corner and clicking on the `copy version information` button" | ||
- type: checkboxes | ||
id: can-reproduce | ||
attributes: | ||
label: "Please verify if you can reproduce this bug on the demo site." | ||
description: "You can sign in at [InvenTree Demo](https://demo.inventree.org) with admin:inventree. Note that this instance runs on the latest dev version, so your bug may be fixed there." | ||
options: | ||
- label: "I can reproduce this bug on the demo site." | ||
- type: textarea | ||
id: logs | ||
attributes: | ||
label: "Relevant log output" | ||
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. | ||
render: shell | ||
validations: | ||
required: false |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: "Documentation" | ||
description: "Create an issue to improve the documentation" | ||
labels: ["documentation", "triage:not-checked"] | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: | | ||
Create a new issue regarding the InvenTree documentation | ||
- type: textarea | ||
id: repro | ||
attributes: | ||
label: Body of the issue | ||
description: Please provide one distinct thing to fix or a clearly defined enhancement | ||
validations: | ||
required: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Feature Request | ||
description: Suggest an idea for this project | ||
title: "[FR] title" | ||
labels: ["enhancement", "triage:not-checked"] | ||
body: | ||
- type: checkboxes | ||
id: no-duplicate-issues | ||
attributes: | ||
label: "Please verify that this feature request has NOT been suggested before." | ||
description: "Search in the issues sections by clicking [HERE](https://github.com/inventree/inventree/issues?q=)" | ||
options: | ||
- label: "I checked and didn't find a similar feature request" | ||
required: true | ||
- type: textarea | ||
id: problem | ||
validations: | ||
required: true | ||
attributes: | ||
label: "Problem statement" | ||
description: "A clear and concise description of the problem or missing feature." | ||
placeholder: "I am always struggling with ..." | ||
- type: textarea | ||
id: solution | ||
validations: | ||
required: true | ||
attributes: | ||
label: "Suggested solution" | ||
description: "A clear and concise description of what you want to happen to solve the problem statement." | ||
placeholder: "In my use-case, ..." | ||
- type: textarea | ||
id: alternatives | ||
validations: | ||
required: true | ||
attributes: | ||
label: "Describe alternatives you've considered" | ||
description: "A clear and concise description of any alternative solutions or features you've considered." | ||
placeholder: "This could also be done by doing ..." | ||
- type: textarea | ||
id: examples | ||
validations: | ||
required: false | ||
attributes: | ||
label: "Examples of other systems" | ||
description: "Show how other software handles your FR if you have examples." | ||
placeholder: "I software xxx this is done in the following way..." | ||
- type: checkboxes | ||
id: self-develop | ||
attributes: | ||
label: "Do you want to develop this?" | ||
description: "This is not required, and you do not need to be a pro - this is just as information for us." | ||
options: | ||
- label: "I want to develop this." | ||
required: false |
Oops, something went wrong.