From 927160c77f45811f8a1b8237544ccd4098390ee8 Mon Sep 17 00:00:00 2001 From: Oliver Date: Tue, 10 Sep 2019 10:33:44 +1000 Subject: [PATCH 1/5] Create CONTRIBUTING.md --- CONTRIBUTING.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000000..027d3641cb --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,18 @@ +Contributions to InvenTree are welcomed - please follow the guidelines below. + +## Feature Branches + +No pushing to master! New featues must be submitted in a separate branch (one branch per feature). + +## Testing + +Any new code should be covered by unit tests - a submitted PR may not be accepted if the code coverage is decreased. + +## Documentation + +New features or updates to existing features should be accompanied by user documentation. +A PR with associated documentation should link to the matching PR at https://github.com/inventree/InvenTree.github.io + +## Code Style + +Sumbitted Python code is automatically checked against PEP style guidelines. Locally you can run `make style` to ensure the style checks will pass, before submitting the PR. From 4daf1ae8d4cb6696060466f8d0ca808fc832e3a4 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Tue, 10 Sep 2019 14:18:20 +1000 Subject: [PATCH 2/5] Fixes for migrate target in makefile --- InvenTree/config_template.yaml | 6 +++--- Makefile | 22 ++++++++-------------- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/InvenTree/config_template.yaml b/InvenTree/config_template.yaml index e5747a19c5..1799b49e1a 100644 --- a/InvenTree/config_template.yaml +++ b/InvenTree/config_template.yaml @@ -5,7 +5,7 @@ database: # Example configuration - sqlite (default) ENGINE: django.db.backends.sqlite3 - NAME: inventree_db.sqlite3 + NAME: '../inventree_default_db.sqlite3' # For more complex database installations, further parameters are required # Refer to the django documentation for full list of options @@ -41,11 +41,11 @@ cors: # MEDIA_ROOT is the local filesystem location for storing uploaded files # By default, it is stored in a directory named 'media' local to the InvenTree directory # This should be changed for a production installation -media_root: './media' +media_root: '../inventree_media' # STATIC_ROOT is the local filesystem location for storing static files # By default it is stored in a directory named 'static' local to the InvenTree directory -static_root: './static' +static_root: '../inventree_static' # Logging options log_queries: False diff --git a/Makefile b/Makefile index f16ed77041..667d49f83a 100644 --- a/Makefile +++ b/Makefile @@ -11,26 +11,20 @@ update: backup install migrate # Perform database migrations (after schema changes are made) migrate: - python3 InvenTree/manage.py makemigrations common - python3 InvenTree/manage.py makemigrations company - python3 InvenTree/manage.py makemigrations part - python3 InvenTree/manage.py makemigrations stock - python3 InvenTree/manage.py makemigrations build - python3 InvenTree/manage.py makemigrations order - python3 InvenTree/manage.py makemigrations + cd InvenTree && python3 manage.py makemigrations cd InvenTree && python3 manage.py migrate cd InvenTree && python3 manage.py migrate --run-syncdb - python3 InvenTree/manage.py check + cd InvenTree && python3 manage.py check cd InvenTree && python3 manage.py collectstatic # Install all required packages install: pip3 install -U -r requirements.txt - python3 InvenTree/setup.py + cd InvenTree && python3 setup.py # Create a superuser account superuser: - python3 InvenTree/manage.py createsuperuser + cd InvenTree && python3 manage.py createsuperuser # Install pre-requisites for mysql setup mysql: @@ -48,8 +42,8 @@ style: # Run unit tests test: - python3 InvenTree/manage.py check - python3 InvenTree/manage.py test build common company order part stock + cd InvenTree && python3 manage.py check + cd InvenTree && python3 manage.py test build common company order part stock # Run code coverage coverage: @@ -67,7 +61,7 @@ docs: # Make database backup backup: - python3 InvenTree/manage.py dbbackup - python3 InvenTree/manage.py mediabackup + cd InvenTree && python3 manage.py dbbackup + cd InvenTree && python3 manage.py mediabackup .PHONY: clean migrate superuser install mysql postgresql style test coverage docreqs docs backup update \ No newline at end of file From b9109cf6847e91bd2bf2c8b6f227474c4452d4e8 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Tue, 10 Sep 2019 14:32:29 +1000 Subject: [PATCH 3/5] Travis CI tests superuser creation --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 00d049b7a1..78b3b59225 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,7 @@ addons: before_install: - make install - make migrate + - cd InvenTree && python3 manage.py createsuper --username InvenTreeAdmin --email admin@inventree.com --noinput script: - git ls-files --exclude-standard --others From 73749911f8bfc35a3c87fe12e30cbb9377b55f6b Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Tue, 10 Sep 2019 14:37:03 +1000 Subject: [PATCH 4/5] Fixed typo --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 78b3b59225..eed1d6ad0a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ addons: before_install: - make install - make migrate - - cd InvenTree && python3 manage.py createsuper --username InvenTreeAdmin --email admin@inventree.com --noinput + - cd InvenTree && python3 manage.py createsuperuser --username InvenTreeAdmin --email admin@inventree.com --noinput script: - git ls-files --exclude-standard --others From f5d26a83f5391bc8023528a731157a32d16e294a Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Tue, 10 Sep 2019 14:40:29 +1000 Subject: [PATCH 5/5] Fixed cwd for .travis.yml --- .travis.yml | 2 +- Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index eed1d6ad0a..fda3b78259 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ addons: before_install: - make install - make migrate - - cd InvenTree && python3 manage.py createsuperuser --username InvenTreeAdmin --email admin@inventree.com --noinput + - cd InvenTree && python3 manage.py createsuperuser --username InvenTreeAdmin --email admin@inventree.com --noinput && cd .. script: - git ls-files --exclude-standard --others diff --git a/Makefile b/Makefile index 667d49f83a..fc3e4d64e1 100644 --- a/Makefile +++ b/Makefile @@ -47,7 +47,7 @@ test: # Run code coverage coverage: - python3 InvenTree/manage.py check + cd InvenTree && python3 manage.py check coverage run InvenTree/manage.py test build common company order part stock InvenTree coverage html